mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 18:32:41 +00:00
Add Notification lookup to Admin API
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const HomebrewModel = require('./homebrew.model.js').model;
|
||||
const NotificationModel = require('./notifications.model.js').model;
|
||||
const router = require('express').Router();
|
||||
const Moment = require('moment');
|
||||
//const render = require('vitreum/steps/render');
|
||||
@@ -99,6 +100,15 @@ router.get('/admin/stats', mw.adminOnly, (req, res)=>{
|
||||
});
|
||||
});
|
||||
|
||||
/* Searches for matching edit or share id, also attempts to partial match */
|
||||
router.get('/admin/notification/lookup/:id', mw.adminOnly, (req, res, next)=>{
|
||||
NotificationModel.findOne({ $or : [
|
||||
{ dismissKey: { '$regex': req.params.id } },
|
||||
] }).exec((err, notification)=>{
|
||||
return res.json(notification);
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/admin', mw.adminOnly, (req, res)=>{
|
||||
templateFn('admin', {
|
||||
url : req.originalUrl
|
||||
|
||||
Reference in New Issue
Block a user