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:
Radosław Gierwiało
2025-11-14 14:20:20 +01:00
parent 71cba01db3
commit 6823851b63
2 changed files with 37 additions and 9 deletions

View File

@@ -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,