Notifiche - Tutti - non letti
This commit is contained in:
@@ -15,6 +15,8 @@ const sendemail = require('../sendemail');
|
||||
|
||||
const {Settings} = require('../models/settings');
|
||||
|
||||
const {SendNotif} = require('../models/sendnotif');
|
||||
|
||||
const tools = require('../tools/general');
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
@@ -377,11 +379,15 @@ router.patch('/:id', authenticate, (req, res) => {
|
||||
|
||||
router.post('/profile', authenticate, (req, res) => {
|
||||
const username = req.body['username'];
|
||||
idapp = req.body.idapp;
|
||||
locale = req.body.locale;
|
||||
const idapp = req.body.idapp;
|
||||
const locale = req.body.locale;
|
||||
const idnotif = req.body['idnotif'] ? req.body['idnotif'] : '';
|
||||
|
||||
//++Todo: controlla che tipo di dati ha il permesso di leggere
|
||||
|
||||
// Check if ìs a Notif to read
|
||||
SendNotif.setNotifAsRead(idapp, username, idnotif);
|
||||
|
||||
try {
|
||||
return User.getUserProfileByUsername(idapp, username, req.user.username,
|
||||
false, req.user.perm).
|
||||
@@ -447,7 +453,7 @@ router.post('/notifs', authenticate, async (req, res) => {
|
||||
|
||||
try {
|
||||
if (!!myuser) {
|
||||
if (notifs) {
|
||||
if (tools.isArray(notifs) && notifs.length >= 0) {
|
||||
myuser.profile.notifs = notifs;
|
||||
myuser.save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user