FIX delete buchung call
This commit is contained in:
@@ -79,4 +79,4 @@ services:
|
|||||||
- traefik-net
|
- traefik-net
|
||||||
networks:
|
networks:
|
||||||
traefik-net:
|
traefik-net:
|
||||||
external: true
|
external: false
|
||||||
@@ -36,9 +36,10 @@
|
|||||||
|
|
||||||
async function confirmDelete() {
|
async function confirmDelete() {
|
||||||
if (confirmId === null) return;
|
if (confirmId === null) return;
|
||||||
deletingId = confirmId;
|
const idToDelete = confirmId;
|
||||||
|
deletingId = idToDelete;
|
||||||
confirmId = null;
|
confirmId = null;
|
||||||
await api.companyAdmin.deleteTallyEntry(token, deletingId);
|
await api.companyAdmin.deleteTallyEntry(token, idToDelete);
|
||||||
deletingId = null;
|
deletingId = null;
|
||||||
await loadEntries();
|
await loadEntries();
|
||||||
}
|
}
|
||||||
@@ -119,14 +120,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if confirmId !== null}
|
{#if confirmId !== null}
|
||||||
|
{@const confirmEntry = entries.find(e => e.id === confirmId)}
|
||||||
<div class="modal-overlay" on:click|self={() => confirmId = null}>
|
<div class="modal-overlay" on:click|self={() => confirmId = null}>
|
||||||
<div class="modal">
|
<div class="modal">
|
||||||
<h2>Eintrag löschen?</h2>
|
<h2>Eintrag löschen?</h2>
|
||||||
{#if entries.find(e => e.id === confirmId) as entry}
|
{#if confirmEntry}
|
||||||
<p style="margin: 16px 0; color: var(--color-text-muted);">
|
<p style="margin: 16px 0; color: var(--color-text-muted);">
|
||||||
<strong style="color: var(--color-text-muted);">{entry.employeeFirstName} {entry.employeeLastName}</strong>
|
<strong style="color: var(--color-text-muted);">{confirmEntry.employeeFirstName} {confirmEntry.employeeLastName}</strong>
|
||||||
– {entry.productName} ({formatPrice(entry.priceCents)})
|
– {confirmEntry.productName} ({formatPrice(confirmEntry.priceCents)})
|
||||||
am {formatDateTime(entry.createdAt)}
|
am {formatDateTime(confirmEntry.createdAt)}
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
<p style="margin-bottom: 20px; font-size: 0.9rem;">Dieser Eintrag wird unwiderruflich gelöscht.</p>
|
<p style="margin-bottom: 20px; font-size: 0.9rem;">Dieser Eintrag wird unwiderruflich gelöscht.</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user