From 357ec3f3e1380741d2fed4fc5013f436a3d413c3 Mon Sep 17 00:00:00 2001 From: Padreug Date: Sun, 26 Apr 2026 23:44:39 +0200 Subject: [PATCH] fix: use POST endpoint for ticket purchase (upstream API compat) The GET /tickets/{event_id}/user/{user_id} endpoint was a custom addition not present in the upstream LNbits events extension. Use the canonical POST /tickets/{event_id} with user_id in the body. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/modules/activities/services/TicketApiService.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/activities/services/TicketApiService.ts b/src/modules/activities/services/TicketApiService.ts index ed11b3e..918b0c3 100644 --- a/src/modules/activities/services/TicketApiService.ts +++ b/src/modules/activities/services/TicketApiService.ts @@ -36,6 +36,7 @@ export class TicketApiService { /** * Request a ticket purchase (creates a Lightning invoice). + * Uses POST /tickets/{event_id} with user_id in body (upstream API). */ async requestTicket( eventId: string, @@ -43,12 +44,14 @@ export class TicketApiService { accessToken: string ): Promise { const data = await this.request( - `/events/api/v1/tickets/${eventId}/user/${userId}`, + `/events/api/v1/tickets/${eventId}`, { - method: 'GET', + method: 'POST', headers: { + 'Content-Type': 'application/json', 'Authorization': `Bearer ${accessToken}`, }, + body: JSON.stringify({ user_id: userId }), } )