feat: auto-register walk-in attendees during check-in
- Automatically register users who scan QR code but aren't pre-registered - Mark walk-in registrations with wasWalkIn flag - Show different success messages for walk-ins vs pre-registered attendees - Check in walk-ins immediately upon registration - Remove 'not registered' error - now handles walk-ins gracefully - Update both QR scan and manual check-in to support walk-ins
This commit is contained in:
@@ -582,20 +582,12 @@ export const eventController = {
|
||||
// Find or create the attendee user
|
||||
const attendeeUserId = await findOrCreateUser(clerkUserId);
|
||||
|
||||
// Check in the attendee
|
||||
// Check in the attendee (will auto-register if not registered)
|
||||
const result = await eventService.checkInAttendee(id, attendeeUserId);
|
||||
|
||||
res.json(result);
|
||||
} catch (error: any) {
|
||||
console.error('Error checking in attendee:', error);
|
||||
|
||||
if (error.message.includes('not registered')) {
|
||||
return res.status(404).json({
|
||||
code: 'NOT_REGISTERED',
|
||||
message: error.message,
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
}
|
||||
|
||||
if (error.message.includes('already checked in')) {
|
||||
return res.status(409).json({
|
||||
|
||||
Reference in New Issue
Block a user