Switched donor loading to non-paginated

This commit is contained in:
Nicolai Ort 2023-05-09 10:43:33 +02:00
parent 6364536dcd
commit 59fe2dfabb
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
3 changed files with 1036 additions and 1045 deletions

View File

@ -98,35 +98,22 @@
} }
} }
} }
onMount(()=>{
loadDonorsAndRunnersPaginated();
})
async function loadDonorsAndRunnersPaginated() { onMount(async () => {
let page = 0; toast.loading($_("loading-donors"));
let pagesize = 500; donors = (await DonorService.donorControllerGetAll()).map(
while (page >= 0) { (r) => {
const don = await DonorService.donorControllerGetAll(page, pagesize); return { label: getDonorLabel(r), value: r };
const run = await RunnerService.runnerControllerGetAll(page, pagesize);
if (don.length == 0 && run.length == 0) {
page = -2;
} }
);
donors = donors.concat( runners = (await RunnerService.runnerControllerGetAll()).map(
...run.map((r) => { (r) => {
return { label: getDonorLabel(r), value: r }; return { label: getDonorLabel(r), value: r };
}) }
); );
runners = runners.concat( toast.dismiss();
...run.map((r) => { toast.success($_("all-donors-loaded"));
return { label: getDonorLabel(r), value: r }; });
})
);
dataLoaded = true;
page++;
}
}
</script> </script>
{#if modal_open} {#if modal_open}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff