revert: buggy pagination
continuous-integration/drone/push Build is failing Details

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 () => {
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;
}
const donations = await DonationService.donationControllerGetAll();
current_donations = donations;
options.update((options) => ({
...options,
data: current_donations,
}));
dataLoaded = true;
});
</script>

View File

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

View File

@ -161,22 +161,13 @@
}
);
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++;
}
const runners = await RunnerService.runnerControllerGetAll();
current_runners = runners;
options.update((options) => ({
...options,
data: current_runners,
}));
dataLoaded = true;
});
</script>

View File

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