- fix notifiche
This commit is contained in:
@@ -161,7 +161,7 @@ sendNotifSchema.statics.getRecNotif = function (id) {
|
||||
|
||||
};
|
||||
|
||||
sendNotifSchema.statics.findAllNotifByUsernameIdAndIdApp = function (username, lastdataread, idapp, limitrecord, typedir) {
|
||||
sendNotifSchema.statics.findAllNotifByUsernameIdAndIdApp = function (username, lastdataread, idapp, limitrecord, qualinotif) {
|
||||
const SendNotif = this;
|
||||
|
||||
if (!lastdataread)
|
||||
@@ -173,8 +173,13 @@ sendNotifSchema.statics.findAllNotifByUsernameIdAndIdApp = function (username, l
|
||||
{ datenotif: { $gt: new Date(lastdataread) } }
|
||||
];
|
||||
|
||||
if (typedir) {
|
||||
arrfilter.push({typedir});
|
||||
if (qualinotif) {
|
||||
if (qualinotif === shared_consts.QualiNotifs.CIRCUITS) {
|
||||
arrfilter.push({ typedir: shared_consts.TypeNotifs.TYPEDIR_CIRCUITS });
|
||||
} else {
|
||||
arrfilter.push({ typedir: { $ne: shared_consts.TypeNotifs.TYPEDIR_CIRCUITS } });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return SendNotif.find({
|
||||
|
||||
Reference in New Issue
Block a user