From c411691fd64ae153f97724cd88187ff000228f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Fri, 13 Sep 2024 20:29:09 +0200 Subject: [PATCH] remove lookup by id and admin access middleware from lookup all --- server/admin.api.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/server/admin.api.js b/server/admin.api.js index 58958da3d..55bea2892 100644 --- a/server/admin.api.js +++ b/server/admin.api.js @@ -141,21 +141,7 @@ router.get('/admin/stats', mw.adminOnly, async (req, res)=>{ // ####################### NOTIFICATIONS -/* Searches for notification with matching key */ -router.get('/admin/notification/lookup/:id', mw.adminOnly, async (req, res, next) => { - try { - const notification = await NotificationModel.findOne({ dismissKey: req.params.id }).exec(); - if (!notification) { - return res.status(404).json({ message: 'Notification not found' }); - } - return res.json(notification); - } catch (err) { - return next(err); - } -}); - -// get all notifications -router.get('/admin/notification/all', mw.adminOnly, async (req, res, next) => { +router.get('/admin/notification/all', async (req, res, next) => { try { const notifications = await NotificationModel.getAll(); return res.json(notifications);