revert: buggy pagination
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Philipp Dormann 2023-05-04 14:32:37 +02:00
parent 53e3ddb751
commit b2648645e8
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314
4 changed files with 28 additions and 75 deletions

View File

@ -167,27 +167,13 @@
} }
onMount(async () => { onMount(async () => {
let page = 0; const donations = await DonationService.donationControllerGetAll();
let pagesize = 100; current_donations = donations;
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.update((options) => ({
...options, ...options,
data: current_donations, data: current_donations,
})); }));
dataLoaded = true; dataLoaded = true;
page++;
pagesize += 100;
}
}); });
</script> </script>

View File

@ -146,24 +146,13 @@
} }
onMount(async () => { onMount(async () => {
let page = 0; const donors = await DonorService.donorControllerGetAll();
let pagesize = 100; current_donors = donors;
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.update((options) => ({
...options, ...options,
data: current_donors, data: donors,
})); }));
dataLoaded = true; dataLoaded = true;
page++;
pagesize += 100;
}
}); });
</script> </script>

View File

@ -161,22 +161,13 @@
} }
); );
let page = 0; const runners = await RunnerService.runnerControllerGetAll();
while (page >= 0) { current_runners = runners;
const runners = await RunnerService.runnerControllerGetAll(page, 500);
if (runners.length == 0) {
page = -2;
}
current_runners = current_runners.concat(...runners);
options.update((options) => ({ options.update((options) => ({
...options, ...options,
data: current_runners, data: current_runners,
})); }));
dataLoaded = true; dataLoaded = true;
page++;
}
}); });
</script> </script>

View File

@ -178,26 +178,13 @@
} }
onMount(async () => { onMount(async () => {
let page = 0; const scans = await ScanService.scanControllerGetAll();
let pagesize = 100; current_scans = scans;
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.update((options) => ({
...options, ...options,
data: current_scans, data: current_scans,
})); }));
dataLoaded = true; dataLoaded = true;
page++;
if (pagesize < 1000) {
pagesize += 100;
}
}
}); });
</script> </script>