Extracted deletion into function of overview
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import { clickOutside } from "../base/outsideclick";
|
||||
|
||||
import { RunnerService } from "@odit/lfk-client-js";
|
||||
import Toastify from "toastify-js";
|
||||
import { createEventDispatcher } from "svelte";
|
||||
export let modal_open;
|
||||
export let delete_runner = {
|
||||
id: 0,
|
||||
firstname: "",
|
||||
lastname: "",
|
||||
};
|
||||
export let current_runners;
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
function focus(el) {
|
||||
el.focus();
|
||||
@@ -30,13 +28,7 @@
|
||||
};
|
||||
})();
|
||||
async function submit() {
|
||||
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();
|
||||
dispatch('delete', {id: delete_runner.id})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user