From 5f5749ce0496a7996c19dbe8dc853574a66c79ca Mon Sep 17 00:00:00 2001 From: Apoorva Pendse <102853901+apoorvapendse@users.noreply.github.com> Date: Sat, 10 Jun 2023 22:31:49 +0530 Subject: [PATCH 1/2] added the notificationIds parameter for mark multiple notifs as read This is made to solve issue #14484 --- website/server/controllers/api-v3/notifications.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/server/controllers/api-v3/notifications.js b/website/server/controllers/api-v3/notifications.js index 8ded24d5ebd..def2158a35f 100644 --- a/website/server/controllers/api-v3/notifications.js +++ b/website/server/controllers/api-v3/notifications.js @@ -51,15 +51,17 @@ api.readNotification = { }; /** - * @api {post} /api/v3/notifications/read Mark multiple notifications as read + * @api {post} /api/v3/notifications/:notificationIds/read Mark multiple notifications as read * @apiName ReadNotifications * @apiGroup Notification * + * @apiParam (Path) {UUID} notificationIds + * * @apiSuccess {Object} data user.notifications */ api.readNotifications = { method: 'POST', - url: '/notifications/read', + url: '/notifications/:notificationIds/read', middlewares: [authWithHeaders()], async handler (req, res) { const { user } = res.locals; From 3c906a89b0ccc175abd7c86b2dd98b155bbd6bd9 Mon Sep 17 00:00:00 2001 From: ApoorvaPendse <102853901+apoorvapendse@users.noreply.github.com> Date: Mon, 26 Jun 2023 18:17:47 +0530 Subject: [PATCH 2/2] fixed the body request --- website/server/controllers/api-v3/notifications.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/server/controllers/api-v3/notifications.js b/website/server/controllers/api-v3/notifications.js index def2158a35f..71545d4ba32 100644 --- a/website/server/controllers/api-v3/notifications.js +++ b/website/server/controllers/api-v3/notifications.js @@ -51,17 +51,17 @@ api.readNotification = { }; /** - * @api {post} /api/v3/notifications/:notificationIds/read Mark multiple notifications as read + * @api {post} /api/v3/notifications/read Mark multiple notifications as read * @apiName ReadNotifications * @apiGroup Notification * - * @apiParam (Path) {UUID} notificationIds + * @apiParam (Body) {String[]} notificationIds Array of UUIDs of notificationIds * * @apiSuccess {Object} data user.notifications */ api.readNotifications = { method: 'POST', - url: '/notifications/:notificationIds/read', + url: '/notifications/read', middlewares: [authWithHeaders()], async handler (req, res) { const { user } = res.locals;