feat(donations): Donations reactive create and load into datatable

This commit is contained in:
2023-04-19 17:21:24 +02:00
parent 133470b6f2
commit 02003ec80e
4 changed files with 238 additions and 192 deletions

View File

@@ -4,11 +4,13 @@
import { DonationService } from "@odit/lfk-client-js";
import Toastify from "toastify-js";
import { createEventDispatcher } from "svelte";
export let payment_modal_open = false;
export let current_donations = [];
export let editable = {};
export let original_data = {};
export let paid_amount_input = 0;
const dispatch = createEventDispatcher();
$:processed_last_submit=true;
function focus(el) {
el.focus();
@@ -52,8 +54,7 @@
duration: 500,
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
}).showToast();
current_donations[current_donations.findIndex((c) => c.id === id)] = result;
current_donations = current_donations;
dispatch("created", {donation: response})
})
.catch((err) => {
//