mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-31 10:52:42 +00:00
WIP commit
This commit is contained in:
@@ -110,6 +110,7 @@ router.get('/admin/notification/lookup/:id', mw.adminOnly, (req, res, next)=>{
|
||||
|
||||
/* Add new notification */
|
||||
router.post('/admin/notification/add', mw.adminOnly, async (req, res, next)=>{
|
||||
console.log(req.body);
|
||||
const notification = await NotificationModel.addNotification(req.body);
|
||||
return res.json(notification);
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ NotificationSchema.statics.addNotification = async function(data){
|
||||
const newNotification = new Notification(data);
|
||||
const savedNotification = await newNotification.save()
|
||||
.catch((err)=>{
|
||||
return { err: err };
|
||||
return { err };
|
||||
});
|
||||
|
||||
return savedNotification;
|
||||
|
||||
Reference in New Issue
Block a user