diff --git a/backend/src/routes/door.ts b/backend/src/routes/door.ts index d856e0f..608e51c 100644 --- a/backend/src/routes/door.ts +++ b/backend/src/routes/door.ts @@ -84,7 +84,8 @@ function toDoorAttendee( }; } -async function loadEvent(eventId: string) { +async function loadEvent(eventId: string | undefined) { + if (!eventId) return null; const event = await dbGet( (db as any).select().from(events).where(eq((events as any).id, eventId)) ); diff --git a/backend/src/routes/payments.ts b/backend/src/routes/payments.ts index 72ad423..2544ad4 100644 --- a/backend/src/routes/payments.ts +++ b/backend/src/routes/payments.ts @@ -667,7 +667,7 @@ paymentsRouter.post('/:id/send-reminder', requireAuth(['admin', 'organizer']), a } try { - const result = await emailService.sendPaymentReminder(id); + const result = await emailService.sendPaymentReminder(payment.id); if (result.success) { const now = getNow(); diff --git a/backend/src/routes/tickets.ts b/backend/src/routes/tickets.ts index 3333b59..49f266c 100644 --- a/backend/src/routes/tickets.ts +++ b/backend/src/routes/tickets.ts @@ -1174,7 +1174,7 @@ ticketsRouter.post('/:id/mark-paid', requireAuth(['admin', 'organizer', 'staff'] // Send confirmation emails asynchronously (don't block the response) Promise.all([ - emailService.sendBookingConfirmation(id), + emailService.sendBookingConfirmation(ticket.id), payment ? emailService.sendPaymentReceipt(payment.id) : Promise.resolve(), ]).catch(err => { console.error('[Email] Failed to send confirmation emails:', err);