Fix user dashboard: buried edit errors, closed events not hidden, closed/past registrations editable

Registration-edit errors were set into a page-level error state rendered
behind the edit modal overlay; they now render inside the modal. The
"Show past events" toggle only hid date-based past events, letting
cashup-closed events leak through by default; a shared isEventOver()
check now covers both, applied to registrations, tickets, and the
Edit button visibility (mirroring the backend's own edit block).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-23 16:43:33 +02:00
parent 890970fffe
commit eb46ed8264
3 changed files with 24 additions and 18 deletions
@@ -415,7 +415,7 @@ const getUserRegistrations = async (req, res) => {
const whereClause = showPast ? { userId: req.user.id } : {
userId: req.user.id,
status: { not: 'cancelled' },
event: { endDate: { gte: now } }
event: { endDate: { gte: now }, cashupStatus: { not: 'closed' } }
};
const registrations = await prisma.registration.findMany({