Switched donor loading to non-paginated
This commit is contained in:
parent
6364536dcd
commit
59fe2dfabb
@ -98,35 +98,22 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
onMount(()=>{
|
||||
loadDonorsAndRunnersPaginated();
|
||||
})
|
||||
|
||||
async function loadDonorsAndRunnersPaginated() {
|
||||
let page = 0;
|
||||
let pagesize = 500;
|
||||
while (page >= 0) {
|
||||
const don = await DonorService.donorControllerGetAll(page, pagesize);
|
||||
const run = await RunnerService.runnerControllerGetAll(page, pagesize);
|
||||
if (don.length == 0 && run.length == 0) {
|
||||
page = -2;
|
||||
}
|
||||
|
||||
donors = donors.concat(
|
||||
...run.map((r) => {
|
||||
onMount(async () => {
|
||||
toast.loading($_("loading-donors"));
|
||||
donors = (await DonorService.donorControllerGetAll()).map(
|
||||
(r) => {
|
||||
return { label: getDonorLabel(r), value: r };
|
||||
})
|
||||
}
|
||||
);
|
||||
runners = runners.concat(
|
||||
...run.map((r) => {
|
||||
runners = (await RunnerService.runnerControllerGetAll()).map(
|
||||
(r) => {
|
||||
return { label: getDonorLabel(r), value: r };
|
||||
})
|
||||
}
|
||||
);
|
||||
|
||||
dataLoaded = true;
|
||||
page++;
|
||||
}
|
||||
}
|
||||
toast.dismiss();
|
||||
toast.success($_("all-donors-loaded"));
|
||||
});
|
||||
</script>
|
||||
|
||||
{#if modal_open}
|
||||
|
@ -506,5 +506,7 @@
|
||||
"you-have-to-provide-an-organization": "Du musst eine Organisation angeben",
|
||||
"you-have-to-save-your-changes-to-generate-a-link": "Du musst deine Änderungen speichern, um einen Link zu generieren.",
|
||||
"you-must-create-at-least-one-card-or-cancel": "Du musst mindestens eine Blankokarte erstellen.",
|
||||
"zip-postal-code": "Postleitzahl"
|
||||
"zip-postal-code": "Postleitzahl",
|
||||
"loading-donors": "Sponsoren werden geladen",
|
||||
"all-donors-loaded": "Alle Sponsoren geladen"
|
||||
}
|
@ -506,5 +506,7 @@
|
||||
"you-have-to-provide-an-organization": "You have to provide an organization",
|
||||
"you-have-to-save-your-changes-to-generate-a-link": "You have to save your changes to generate a link.",
|
||||
"you-must-create-at-least-one-card-or-cancel": "You must create at least one card.",
|
||||
"zip-postal-code": "ZIP/ postal code"
|
||||
"zip-postal-code": "ZIP/ postal code",
|
||||
"loading-donors": "Loading donors",
|
||||
"all-donors-loaded": "All donors loaded"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user