Extracted deletion into function of overview

This commit is contained in:
2023-04-12 19:14:42 +02:00
parent da3300562a
commit a0727a0291
2 changed files with 17 additions and 12 deletions

View File

@@ -128,6 +128,17 @@
getSortedRowModel: getSortedRowModel(),
});
const table = createSvelteTable(options);
async function deleteRunner(id) {
await RunnerService.runnerControllerRemove(delete_runner.id, true);
current_runners = current_runners.filter((r) => r.id !== delete_runner.id);
Toastify({
text: $_("runner-deleted"),
duration: 3500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
}
onMount(() => {
RunnerService.runnerControllerGetAll().then((val) => {
current_runners = val;
@@ -152,7 +163,9 @@
<DeleteRunnerModal
delete_runner={active_delete}
modal_open={active_delete != undefined}
bind:current_runners
on:delete={(event) => {
deleteRunner(event.detail.id);
}}
/>
{#if store.state.jwtinfo.userdetails.permissions.includes("RUNNER:GET")}
{#if !dataLoaded}