diff --git a/frontend/src/dataloaders/ProjectsTeacherLoader.ts b/frontend/src/dataloaders/ProjectsTeacherLoader.ts index 74fb9d30..2d95518d 100644 --- a/frontend/src/dataloaders/ProjectsTeacherLoader.ts +++ b/frontend/src/dataloaders/ProjectsTeacherLoader.ts @@ -47,12 +47,12 @@ export async function LoadProjectsForTeacher(filter_on_current: boolean = false, const allGroups: (Group[]|undefined)[] = (await groupPromises) const groups: Group[][] = allGroups.filter(group => group !== undefined) as Group[][] + const groupsR = await Promise.all(groups.map(groupArray => Promise.all(groupArray.map(group => apiFetch(`/groups/${group.group_id}/submission`))))); const amount_of_submissions: number[] = [] - for (const groupArray of groups) { + for (const groupArray of groupsR) { let amount = 0 - for (const group of groupArray) { + for (const submissionData of groupArray) { try { - const submissionData = await apiFetch(`/groups/${group.group_id}/submission`); if (!submissionData.ok){ continue }