Moved update card logic to overview

This commit is contained in:
2023-04-12 20:14:04 +02:00
parent f6985daec7
commit 53b945c72f
2 changed files with 16 additions and 10 deletions

View File

@@ -116,6 +116,12 @@
const table = createSvelteTable(options);
function open_edit_modal(card) {
const getRunnerLabel = (option) =>
option.firstname +
" " +
(option.middlename || "") +
" " +
option.lastname;
if (card.runner?.id) {
runner = Object.assign(
{ runner },
@@ -134,13 +140,19 @@
{#if store.state.jwtinfo.userdetails.permissions.includes("CARD:UPDATE")}
<CardDetailModal
bind:current_cards
bind:edit_modal_open
bind:runner
bind:editable
bind:original_data
on:dataUpdated={() => {
//TODO:
on:dataUpdated={(event) => {
current_cards[
current_cards.findIndex((c) => c.id === event.detail.card.id)
] = event.detail.card;
current_cards = current_cards;
options.update((options) => ({
...options,
data: current_cards,
}));
}}
/>
{/if}