明树Git Lab

Commit 23cf8001 authored by zengfanpei's avatar zengfanpei

update

parent 047d74ee
...@@ -36,6 +36,15 @@ async function getNotice(req, res, next) { ...@@ -36,6 +36,15 @@ async function getNotice(req, res, next) {
next(error) next(error)
} }
} }
async function deleteNotice(req, res, next) {
try {
let userId = req.user._id;
await DB.Notice.findOneAndUpdate({ _id: req.body._id, receiveUser: userId }, { read: true, del: 1 });
return res.sendData({});
} catch (error) {
next(error)
}
}
...@@ -53,6 +62,7 @@ async function getNotice(req, res, next) { ...@@ -53,6 +62,7 @@ async function getNotice(req, res, next) {
module.exports = { module.exports = {
list, list,
getNotice getNotice,
deleteNotice,
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ const noticeController = require('../controller/noticeController'); ...@@ -6,6 +6,7 @@ const noticeController = require('../controller/noticeController');
router.post('/list', noticeController.list); router.post('/list', noticeController.list);
router.post('/info', noticeController.getNotice); router.post('/info', noticeController.getNotice);
router.post('/delete', noticeController.deleteNotice);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment