Notification New Group

This commit is contained in:
paoloar77
2022-07-28 23:27:51 +02:00
parent 7cda5dbb8b
commit 241e4255d4
9 changed files with 63 additions and 32 deletions

View File

@@ -44,7 +44,7 @@ router.post('/', authenticate, (req, res) => {
}).then(async (recmyevent) => {
// tools.mylog('myevent:', myevent);
// tools.mylog('already exist');
SendNotif.createNewNotification(req, res, shared_consts.TABLES_MYEVENTS, recmyevent, shared_consts.TypeNotifs.TYPEDIR_EVENTS, shared_consts.TypeNotifs.ID_EVENTS_NEW_REC);
SendNotif.createNewNotification(req, res, {}, shared_consts.TABLES_MYEVENTS, recmyevent, shared_consts.TypeNotifs.TYPEDIR_EVENTS, shared_consts.TypeNotifs.ID_EVENTS_NEW_REC);
return res;
}).then((res) => {
res.send({code: server_constants.RIS_CODE_OK, msg: '', id: recmyevent._id});
@@ -59,7 +59,7 @@ router.post('/', authenticate, (req, res) => {
myevent.findById(idobj).then((recmyevent) => {
recmyevent.typedir = shared_consts.TypeNotifs.TYPEDIR_EVENTS
recmyevent.typeid = shared_consts.TypeNotifs.ID_EVENTS_NEW_REC
SendNotif.createNewNotification(req, res, shared_consts.TABLES_MYEVENTS, recmyevent, shared_consts.TypeNotifs.TYPEDIR_EVENTS, shared_consts.TypeNotifs.ID_EVENTS_NEW_REC);
SendNotif.createNewNotification(req, res, {}, shared_consts.TABLES_MYEVENTS, recmyevent, shared_consts.TypeNotifs.TYPEDIR_EVENTS, shared_consts.TypeNotifs.ID_EVENTS_NEW_REC);
return res.send({code: server_constants.RIS_CODE_OK, msg: '', id: recmyevent._id});
});
});
@@ -79,7 +79,7 @@ router.delete('/:id/:notify/:idapp', authenticate, (req, res) => {
}
if (notify === '1') {
SendNotif.createNewNotification(req, res, shared_consts.TABLES_MYEVENTS, recmyevent, shared_consts.TypeNotifs.TYPEDIR_EVENTS, shared_consts.TypeNotifs.ID_EVENTS_REMOVE_REC);
SendNotif.createNewNotification(req, res, {}, shared_consts.TABLES_MYEVENTS, recmyevent, shared_consts.TypeNotifs.TYPEDIR_EVENTS, shared_consts.TypeNotifs.ID_EVENTS_REMOVE_REC);
}
tools.mylog('DELETED ', recmyevent.descr, recmyevent._id);