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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user