fix: improve event check-in UX and participant counting
Backend: - Use _count.participants for accurate real-time participant count - Remove reliance on stale participantsCount column Frontend: - Show check-in requirement message for non-joined events - Display "Open chat" button only for joined events - Add dev-only "View details" button for QR code access during testing - Improve visual feedback with amber-colored check-in notice This ensures the participant count reflects actual checked-in users and prevents unauthorized access to QR codes in production while maintaining developer convenience in development mode.
This commit is contained in:
@@ -19,7 +19,6 @@ router.get('/', authenticate, async (req, res, next) => {
|
||||
startDate: true,
|
||||
endDate: true,
|
||||
worldsdcId: true,
|
||||
participantsCount: true,
|
||||
description: true,
|
||||
createdAt: true,
|
||||
participants: {
|
||||
@@ -30,6 +29,11 @@ router.get('/', authenticate, async (req, res, next) => {
|
||||
joinedAt: true,
|
||||
},
|
||||
},
|
||||
_count: {
|
||||
select: {
|
||||
participants: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -42,7 +46,7 @@ router.get('/', authenticate, async (req, res, next) => {
|
||||
startDate: event.startDate,
|
||||
endDate: event.endDate,
|
||||
worldsdcId: event.worldsdcId,
|
||||
participantsCount: event.participantsCount,
|
||||
participantsCount: event._count.participants,
|
||||
description: event.description,
|
||||
createdAt: event.createdAt,
|
||||
isJoined: event.participants.length > 0,
|
||||
|
||||
Reference in New Issue
Block a user