Notifications
Settings Notifications User Panel
This commit is contained in:
@@ -253,6 +253,7 @@ router.post('/settable', authenticate, async (req, res) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (params.table === shared_consts.TAB_MYGROUPS) {
|
||||
if (shared_consts.MYGROUPS_KEY_TO_CRYPTED in mydata) {
|
||||
if (mydata[shared_consts.MYGROUPS_KEY_TO_CRYPTED]) {
|
||||
@@ -338,6 +339,11 @@ router.post('/settable', authenticate, async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
return res.send(myrec);
|
||||
}).catch((e) => {
|
||||
console.error('settable', e.message);
|
||||
@@ -1301,7 +1307,7 @@ router.get(process.env.LINK_CHECK_UPDATES, authenticate, async (req, res) => {
|
||||
|
||||
// msgs = SendMsg.findAllByUserIdAndIdApp(userId, req.user.username, req.user.idapp);
|
||||
let last_msgs = SendMsg.findLastGroupByUserIdAndIdApp(userId, req.user.username, idapp);
|
||||
let last_notifs = SendNotif.findLastGroupByUserIdAndIdApp(userId, req.user.username, idapp);
|
||||
let last_notifs = SendNotif.findLastNotifsByUserIdAndIdApp(req.user.username, idapp, 20);
|
||||
|
||||
let usersList = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user