From 9fd9dd24041403bd9823cf7e252c849963faea4c Mon Sep 17 00:00:00 2001 From: juancarmore Date: Sat, 12 Apr 2025 14:15:51 +0200 Subject: [PATCH] backend: Correct route parameter syntax for meeting routes --- backend/src/middlewares/participant.middleware.ts | 2 +- backend/src/routes/meeting.routes.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/middlewares/participant.middleware.ts b/backend/src/middlewares/participant.middleware.ts index b265c8b..46eb696 100644 --- a/backend/src/middlewares/participant.middleware.ts +++ b/backend/src/middlewares/participant.middleware.ts @@ -55,7 +55,7 @@ export const configureTokenAuth = async (req: Request, res: Response, next: Next }; export const withModeratorPermissions = async (req: Request, res: Response, next: NextFunction) => { - const roomId = req.query.roomId as string; + const { roomId } = req.params; const payload = req.session?.tokenClaims; if (!payload) { diff --git a/backend/src/routes/meeting.routes.ts b/backend/src/routes/meeting.routes.ts index 6efe2cd..f1ffd0c 100644 --- a/backend/src/routes/meeting.routes.ts +++ b/backend/src/routes/meeting.routes.ts @@ -10,13 +10,13 @@ internalMeetingRouter.use(bodyParser.json()); // Internal Meetings Routes internalMeetingRouter.delete( - ':roomId', + '/:roomId', withAuth(participantTokenValidator), withModeratorPermissions, meetingCtrl.endMeeting ); internalMeetingRouter.delete( - ':roomId/participants/:participantName', + '/:roomId/participants/:participantName', withAuth(participantTokenValidator), withModeratorPermissions, participantCtrl.deleteParticipant