Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Perf fix maybe #402

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontend/src/dataloaders/ProjectsTeacherLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Backend_submission>(`/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<Backend_submission>(`/groups/${group.group_id}/submission`);
if (!submissionData.ok){
continue
}
Expand Down