Notifications
Settings Notifications User Panel
This commit is contained in:
@@ -10,6 +10,8 @@ const { User } = require('../models/user');
|
||||
const { Operator } = require('../models/operator');
|
||||
const { SendMsg } = require('../models/sendmsg');
|
||||
|
||||
const {SendNotif} = require('../models/sendnotif');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
const sendemail = require('../sendemail');
|
||||
@@ -46,9 +48,15 @@ router.post('/', authenticate, (req, res) => {
|
||||
// Add this field because I don't want to add into the database
|
||||
recmsg.source.infoevent = body.source.infoevent;
|
||||
|
||||
return await globalTables.sendNotif(res, body.idapp, req.user, recmsg).then((ris) => {
|
||||
return res.send({ code: server_constants.RIS_CODE_OK, msg: '', id: recmsg._id });
|
||||
recmsg.typedir = shared_consts.TypeNotifs.TYPEDIR_EVENTS;
|
||||
recmsg.typeid = shared_consts.TypeNotifs.ID_EVENTS_REMOVE_REC;
|
||||
return SendNotif.saveAndSendNotif(recmyevent, req, res).then((out) => {
|
||||
if (out)
|
||||
return res.send({ code: server_constants.RIS_CODE_OK, msg: '', id: recmsg._id });
|
||||
else
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, msg: '' });
|
||||
})
|
||||
|
||||
});
|
||||
}).catch((e) => {
|
||||
console.log(e.message);
|
||||
|
||||
Reference in New Issue
Block a user