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) <noreply@anthropic.com>
This commit is contained in:
parent
b265296210
commit
357ec3f3e1
1 changed files with 5 additions and 2 deletions
|
|
@ -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<TicketPurchaseInvoice> {
|
||||
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 }),
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue