set notif if service your province
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user