set notif if service your province

This commit is contained in:
Surya Paolo
2023-04-13 13:46:48 +02:00
parent cada7aa0b6
commit cda0bff21f
7 changed files with 136 additions and 35 deletions

View File

@@ -1992,6 +1992,9 @@ module.exports = {
getQueryTable: async function (idapp, params, user) {
const { Search }= require('../models/search');
if (typeof params.startRow !== 'number') {
throw new Error('startRow must be number');
} else if (typeof params.endRow !== 'number') {
@@ -2571,6 +2574,12 @@ module.exports = {
if (querytemp) {
query = [...query, ...querytemp];
}
// Save the search:
if (user._id) {
const mysearch = new Search({idapp, userId: user._id, text: params.filter});
await mysearch.save();
}
}
if (params.table === 'mygroups' || params.table === 'circuits') {
@@ -2718,8 +2727,9 @@ module.exports = {
},
SetBit(myval, bit) {
myval = myval & bit;
return myval;
let myvalout = myval
myvalout |= bit
return myvalout
},
async snooze(ms) {

View File

@@ -362,6 +362,7 @@ module.exports = {
NEW_ADV_MY_GROUPS: 8,
NEW_ADV_MY_RIS_CIRCUIT: 16,
NEW_ADV_SECTOR: 32,
NEW_ADV_YOUR_PROVINCE: 64,
},
StatusNotifs: {
@@ -404,6 +405,7 @@ module.exports = {
TYPEDIR_BACHECA: 1,
ID_BACHECA_NEW_GOOD: 1,
ID_BACHECA_NEW_SERVICE: 2,
ID_BACHECA_NEW_HOSP: 4,
TYPEDIR_EVENTS: 2,
ID_EVENTS_NEW_REC: 1,
@@ -513,7 +515,7 @@ module.exports = {
DEFAULT_NOTIFS_USER: [
{
'dir': 1,
'value': 24
'value': 88
},
{
'dir': 2,