Notification: Set a new Friendship and Accepted Friendship
This commit is contained in:
@@ -339,9 +339,24 @@ router.post('/settable', authenticate, async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
let setnotif = false;
|
||||
let typedir = 0;
|
||||
let typeid = 0;
|
||||
|
||||
if (shared_consts.TABLES_ADV_NOTIFICATION.includes(params.table)) {
|
||||
// E' un annuncio, pertanto mando una notifica a "tutti"
|
||||
SendNotif.createNewNotification(req, res, params.table, myrec, shared_consts.TypeNotifs.TYPEDIR_BACHECA, shared_consts.TypeNotifs.ID_BACHECA_NEW_GOOD);
|
||||
typedir = shared_consts.TypeNotifs.TYPEDIR_BACHECA;
|
||||
typeid = (params.table === shared_consts.TABLES_MYGOODS) ? shared_consts.TypeNotifs.ID_BACHECA_NEW_GOOD : shared_consts.TypeNotifs.ID_BACHECA_NEW_SERVICE
|
||||
setnotif = true;
|
||||
}
|
||||
|
||||
if (shared_consts.TABLES_EVENTS_NOTIFICATION.includes(params.table)) {
|
||||
typedir = shared_consts.TypeNotifs.TYPEDIR_EVENTS;
|
||||
typeid = shared_consts.TypeNotifs.ID_EVENTS_NEW_REC;
|
||||
setnotif = true;
|
||||
}
|
||||
|
||||
if (setnotif) {
|
||||
SendNotif.createNewNotification(req, res, params.table, myrec, typedir, typeid);
|
||||
}
|
||||
|
||||
return res.send(myrec);
|
||||
|
||||
Reference in New Issue
Block a user