Rename paypalLink to paymentLink and allow inline editing
tinyedge/deploy Deployed by TinyEdge

Generalizes the participant link field beyond PayPal and lets users
set/update their payment link directly from the balance summary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-30 17:56:11 +02:00
co-authored by Claude Sonnet 5
parent 2f492c55be
commit f9085d68cd
3 changed files with 121 additions and 39 deletions
+4 -4
View File
@@ -159,18 +159,18 @@ describe('Pot API', async () => {
expect(fetched.expenses).toEqual([])
})
it('syncs a valid PayPal link to a participant and rejects an invalid one', async () => {
it('sets a valid payment link on a participant and rejects an invalid one', async () => {
const pot = await $fetch('/api/pots', { method: 'POST', body: { name: 'Reunion', currency: 'EUR', creatorName: 'Alice' } })
const alice = pot.creator
const updated = await $fetch(`/api/pots/${pot.slug}/participants/${alice.id}`, {
method: 'PATCH',
body: { paypalLink: 'https://paypal.me/alice' },
body: { paymentLink: 'https://paypal.me/alice' },
})
expect(updated.paypalLink).toBe('https://paypal.me/alice')
expect(updated.paymentLink).toBe('https://paypal.me/alice')
await expect(
$fetch(`/api/pots/${pot.slug}/participants/${alice.id}`, { method: 'PATCH', body: { paypalLink: 'javascript:alert(1)' } }),
$fetch(`/api/pots/${pot.slug}/participants/${alice.id}`, { method: 'PATCH', body: { paymentLink: 'javascript:alert(1)' } }),
).rejects.toMatchObject({ statusCode: 400 })
})
})