FIX delete buchung call

This commit is contained in:
2026-05-06 11:14:38 +02:00
parent e57eb7277f
commit a0cceeef78
2 changed files with 9 additions and 7 deletions

View File

@@ -36,9 +36,10 @@
async function confirmDelete() {
if (confirmId === null) return;
deletingId = confirmId;
const idToDelete = confirmId;
deletingId = idToDelete;
confirmId = null;
await api.companyAdmin.deleteTallyEntry(token, deletingId);
await api.companyAdmin.deleteTallyEntry(token, idToDelete);
deletingId = null;
await loadEntries();
}
@@ -119,14 +120,15 @@
</div>
{#if confirmId !== null}
{@const confirmEntry = entries.find(e => e.id === confirmId)}
<div class="modal-overlay" on:click|self={() => confirmId = null}>
<div class="modal">
<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);">
<strong style="color: var(--color-text-muted);">{entry.employeeFirstName} {entry.employeeLastName}</strong>
{entry.productName} ({formatPrice(entry.priceCents)})
am {formatDateTime(entry.createdAt)}
<strong style="color: var(--color-text-muted);">{confirmEntry.employeeFirstName} {confirmEntry.employeeLastName}</strong>
{confirmEntry.productName} ({formatPrice(confirmEntry.priceCents)})
am {formatDateTime(confirmEntry.createdAt)}
</p>
{/if}
<p style="margin-bottom: 20px; font-size: 0.9rem;">Dieser Eintrag wird unwiderruflich gelöscht.</p>