init version
This commit is contained in:
21
engage-api/struct-staff.mjs
Normal file
21
engage-api/struct-staff.mjs
Normal file
@@ -0,0 +1,21 @@
|
||||
// struct-staff.mjs
|
||||
|
||||
let staffs = new Map();
|
||||
|
||||
async function updateStaffMap(staffs,lParms) {
|
||||
for (const staff of lParms) {
|
||||
staffs.set(staff.key, staff.val)
|
||||
}
|
||||
}
|
||||
|
||||
export async function structStaffData(rawActivityData) {
|
||||
let rows = rawActivityData.newRows;
|
||||
for (const rowObject of rows) {
|
||||
for (const field of rowObject.fields) {
|
||||
if (field.fID == "staff") {
|
||||
await updateStaffMap(staffs, field.lParms);
|
||||
return staffs;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user