feat: enable edit buttons for all payments and remove delete functionality

- Remove createdBy restriction from edit buttons in PaymentModal and view pages
- All authenticated users can now edit any payment (including executed recurring payments)
- Remove delete payment functionality from both modal and view pages
- Replace inline edit button with consistent EditButton component in PaymentModal
- Clean up unused delete-related code and variables

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-17 20:43:48 +02:00
parent de20bdb82a
commit ede45816e6
2 changed files with 85 additions and 39 deletions

View File

@@ -72,32 +72,6 @@
}
}
let deleting = false;
async function deletePayment() {
if (!confirm('Are you sure you want to delete this payment? This action cannot be undone.')) {
return;
}
try {
deleting = true;
const response = await fetch(`/api/cospend/payments/${data.paymentId}`, {
method: 'DELETE'
});
if (!response.ok) {
throw new Error('Failed to delete payment');
}
// Redirect to dashboard after successful deletion
goto('/cospend');
} catch (err) {
error = err.message;
} finally {
deleting = false;
}
}
</script>
<svelte:head>
@@ -199,7 +173,7 @@
{/if}
</main>
{#if payment && payment.createdBy === data.session.user.nickname}
{#if payment}
<EditButton href="/cospend/payments/edit/{data.paymentId}" />
{/if}