Log event creation to admin audit log, add back button, bump to 1.10.3 #3

Merged
joshua merged 2 commits from fix/event-create-audit-log-and-back-button into main 2026-08-28 14:49:25 +02:00
2 changed files with 17 additions and 0 deletions
Showing only changes of commit 5b2183677d - Show all commits
+1
View File
@@ -12,6 +12,7 @@ and this project follows [Semantic Versioning](https://semver.org/).
### Fixed
- Creating an event was never recorded in the admin audit log — 1.10.0 added `event_created` as a logged action on the frontend's filter list, but the backend's `createEvent` never actually called `logAdminAction`, only `updateEvent`/`deleteEvent` did. Event creation is now logged the same way.
- Staff cancelling a registration via `PUT /api/registrations/:id` (the staff status-change endpoint, separate from the owner-facing `DELETE /:id` cancel route) wasn't logged at all — only the `DELETE` path logged `registration_cancelled`. Both paths now log it, verified against all six audit categories promised in 1.10.0 (refunds, donation assign/unassign, manual registrations, staff-initiated cancellations, event create/update/delete, settings changes) with no other gaps found.
- Added a "Back to dashboard" link to Admin → Audit log, matching the back-link pattern already used on the Cashup page.
## [1.10.2] - 2026-08-28
@@ -626,6 +626,22 @@ const updateRegistrationStatus = async (req, res) => {
}
});
// This is the staff-only status-change endpoint (separate from the owner-facing
// DELETE /:id cancel route), so any transition into 'cancelled' here is always a
// staff-initiated cancellation — log it the same way DELETE /:id does, so both
// paths land under the one 'registration_cancelled' filter in the audit log.
if (status === 'cancelled' && registration.status !== 'cancelled') {
logAdminAction({
actorId: req.user.id,
actorRole: req.user.role,
action: 'registration_cancelled',
targetType: 'Registration',
targetId: req.params.id,
metadata: { registrationOwnerId: registration.userId, previousStatus: registration.status },
ip: getClientIp(req),
});
}
// Generate tickets and email them when status is manually set to 'paid' by staff
if (status === 'paid') {
(async () => {