feature/175-request_pagination #176

Merged
niggl merged 5 commits from feature/175-request_pagination into dev 2023-04-19 13:37:17 +00:00
Showing only changes of commit c33dfcfddd - Show all commits

View File

@ -32,7 +32,7 @@
export let original_data = {};
export let current_cards = [];
export const addCards = (cards) => {
console.log(cards)
console.log(cards);
current_cards = current_cards.concat(...cards);
options.update((options) => ({
...options,
@ -155,15 +155,29 @@
}).showToast();
}
onMount(() => {
RunnerCardService.runnerCardControllerGetAll().then((val) => {
current_cards = val;
onMount(async () => {
let page = 0;
while (page >= 0) {
const cards = await RunnerCardService.runnerCardControllerGetAll(
page,
500
);
if (cards.length == 0) {
page = -2;
}
current_cards = current_cards.concat(...cards);
options.update((options) => ({
...options,
data: current_cards,
}));
if (page == 0) {
dataLoaded = true;
});
}
page++;
}
console.log("All cards loaded");
});
</script>
@ -229,7 +243,7 @@
...options,
data: current_cards,
}));
$table.resetRowSelection()
$table.resetRowSelection();
}}
>
{$_("delete-cards")}
@ -249,7 +263,10 @@
</svg>
</button>
{/if}
<GenerateRunnerCards cards_show={selected.length>0} bind:generate_cards={selectedCards} />
<GenerateRunnerCards
cards_show={selected.length > 0}
bind:generate_cards={selectedCards}
/>
</div>
<div class="overflow-x-auto">
<table class="w-full">