Revert "revert: buggy pagination"
This reverts commit b2648645e8fc05f8742ecfc592557f954261671b.
This commit is contained in:
parent
b7a53960e5
commit
dacb2f8ace
@ -167,13 +167,27 @@
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
const donations = await DonationService.donationControllerGetAll();
|
||||
current_donations = donations;
|
||||
let page = 0;
|
||||
let pagesize = 100;
|
||||
while (page >= 0) {
|
||||
const donations = await DonationService.donationControllerGetAll(
|
||||
page,
|
||||
pagesize
|
||||
);
|
||||
if (donations.length == 0) {
|
||||
page = -2;
|
||||
}
|
||||
|
||||
current_donations = current_donations.concat(...donations);
|
||||
options.update((options) => ({
|
||||
...options,
|
||||
data: current_donations,
|
||||
}));
|
||||
|
||||
dataLoaded = true;
|
||||
page++;
|
||||
pagesize += 100;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -146,13 +146,24 @@
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
const donors = await DonorService.donorControllerGetAll();
|
||||
current_donors = donors;
|
||||
let page = 0;
|
||||
let pagesize = 100;
|
||||
while (page >= 0) {
|
||||
const donors = await DonorService.donorControllerGetAll(page, pagesize);
|
||||
if (donors.length == 0) {
|
||||
page = -2;
|
||||
}
|
||||
|
||||
current_donors = current_donors.concat(...donors);
|
||||
options.update((options) => ({
|
||||
...options,
|
||||
data: donors,
|
||||
data: current_donors,
|
||||
}));
|
||||
|
||||
dataLoaded = true;
|
||||
page++;
|
||||
pagesize += 100;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -161,13 +161,22 @@
|
||||
}
|
||||
);
|
||||
|
||||
const runners = await RunnerService.runnerControllerGetAll();
|
||||
current_runners = runners;
|
||||
let page = 0;
|
||||
while (page >= 0) {
|
||||
const runners = await RunnerService.runnerControllerGetAll(page, 500);
|
||||
if (runners.length == 0) {
|
||||
page = -2;
|
||||
}
|
||||
|
||||
current_runners = current_runners.concat(...runners);
|
||||
options.update((options) => ({
|
||||
...options,
|
||||
data: current_runners,
|
||||
}));
|
||||
|
||||
dataLoaded = true;
|
||||
page++;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -178,13 +178,26 @@
|
||||
}
|
||||
|
||||
onMount(async () => {
|
||||
const scans = await ScanService.scanControllerGetAll();
|
||||
current_scans = scans;
|
||||
let page = 0;
|
||||
let pagesize = 100;
|
||||
while (page >= 0) {
|
||||
const scans = await ScanService.scanControllerGetAll(page, pagesize);
|
||||
if (scans.length == 0) {
|
||||
page = -2;
|
||||
}
|
||||
|
||||
current_scans = current_scans.concat(...scans);
|
||||
options.update((options) => ({
|
||||
...options,
|
||||
data: current_scans,
|
||||
}));
|
||||
|
||||
dataLoaded = true;
|
||||
page++;
|
||||
if (pagesize < 1000) {
|
||||
pagesize += 100;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user