0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

remove lookup by id and admin access middleware from lookup all

This commit is contained in:
Víctor Losada Hernández
2024-09-13 20:29:09 +02:00
parent 849e5d5d1a
commit c411691fd6

View File

@@ -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);