fix: add support for Clerk IDs and activity endpoint

- Update getUserProfile to accept both database ID and Clerk ID
- Update getUserReports to handle Clerk IDs
- Update getUserEvents to handle Clerk IDs
- Add getUserActivity endpoint to return timeline of user actions
- Add activity route GET /api/users/:id/activity
- Fix TypeScript errors with const assertions

This fixes 404 errors when frontend uses Clerk IDs to fetch user data
This commit is contained in:
2025-11-16 21:39:38 +00:00
parent c84bcb2fd6
commit bee80be87d
4 changed files with 200 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ router.patch('/:id', requireAuth, userController.updateUserProfile.bind(userCont
// User reports and events
router.get('/:id/reports', userController.getUserReports.bind(userController));
router.get('/:id/events', userController.getUserEvents.bind(userController));
router.get('/:id/activity', userController.getUserActivity.bind(userController));
// Notification preferences
router.patch('/:id/preferences', requireAuth, userController.updateNotificationPreferences.bind(userController));