Switched donor loading to non-paginated
This commit is contained in:
parent
6364536dcd
commit
59fe2dfabb
@ -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);
|
|
||||||
const run = await RunnerService.runnerControllerGetAll(page, pagesize);
|
|
||||||
if (don.length == 0 && run.length == 0) {
|
|
||||||
page = -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
donors = donors.concat(
|
|
||||||
...run.map((r) => {
|
|
||||||
return { label: getDonorLabel(r), value: r };
|
return { label: getDonorLabel(r), value: r };
|
||||||
})
|
}
|
||||||
);
|
);
|
||||||
runners = runners.concat(
|
runners = (await RunnerService.runnerControllerGetAll()).map(
|
||||||
...run.map((r) => {
|
(r) => {
|
||||||
return { label: getDonorLabel(r), value: r };
|
return { label: getDonorLabel(r), value: r };
|
||||||
})
|
}
|
||||||
);
|
);
|
||||||
|
toast.dismiss();
|
||||||
dataLoaded = true;
|
toast.success($_("all-donors-loaded"));
|
||||||
page++;
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if modal_open}
|
{#if modal_open}
|
||||||
|
@ -506,5 +506,7 @@
|
|||||||
"you-have-to-provide-an-organization": "Du musst eine Organisation angeben",
|
"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-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.",
|
"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-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-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.",
|
"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