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) { options.update((options) => ({
const donations = await DonationService.donationControllerGetAll( ...options,
page, data: current_donations,
pagesize }));
); dataLoaded = true;
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> </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) { options.update((options) => ({
const donors = await DonorService.donorControllerGetAll(page, pagesize); ...options,
if (donors.length == 0) { data: donors,
page = -2; }));
} dataLoaded = true;
current_donors = current_donors.concat(...donors);
options.update((options) => ({
...options,
data: current_donors,
}));
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); options.update((options) => ({
if (runners.length == 0) { ...options,
page = -2; data: current_runners,
} }));
dataLoaded = true;
current_runners = current_runners.concat(...runners);
options.update((options) => ({
...options,
data: current_runners,
}));
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) { options.update((options) => ({
const scans = await ScanService.scanControllerGetAll(page, pagesize); ...options,
if (scans.length == 0) { data: current_scans,
page = -2; }));
} dataLoaded = true;
current_scans = current_scans.concat(...scans);
options.update((options) => ({
...options,
data: current_scans,
}));
dataLoaded = true;
page++;
if (pagesize < 1000) {
pagesize += 100;
}
}
}); });
</script> </script>