- Fixed pagination not refreshing the data...
- Start creating single page of an Event
This commit is contained in:
@@ -7,6 +7,7 @@ const server_constants = require('../tools/server_constants');
|
||||
const { authenticate } = require('../middleware/authenticate');
|
||||
|
||||
const { User } = require('../models/user');
|
||||
const { Operator } = require('../models/operator');
|
||||
const { SendMsg } = require('../models/sendmsg');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
@@ -17,14 +18,26 @@ const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
const _ = require('lodash');
|
||||
|
||||
function checkifSendPushNotification() {
|
||||
return process.env.ENABLE_PUSHNOTIFICATION === "1";
|
||||
//return false;
|
||||
}
|
||||
|
||||
|
||||
async function sendNotif(res, idapp, user, recmsg) {
|
||||
if (tools.isBitActive(recmsg.options, shared_consts.MessageOptions.Notify_ByPushNotification)) {
|
||||
//++Todo: tools.sendNotificationToUser
|
||||
console.log('SEND PUSH NOTIFICATION ')
|
||||
if (this.checkifSendPushNotification) {
|
||||
console.log('SEND PUSH NOTIFICATION ')
|
||||
//++Todo: tools.sendNotificationToUser
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Extract the Email Destination
|
||||
const emaildest = await User.getEmailByUsername(recmsg.dest.idapp, recmsg.dest.username);
|
||||
// Read from the operator table first
|
||||
let emaildest = await Operator.getEmailByUsername(recmsg.dest.idapp, recmsg.dest.username);
|
||||
if (emaildest === '')
|
||||
emaildest = await User.getEmailByUsername(recmsg.dest.idapp, recmsg.dest.username);
|
||||
|
||||
console.log('emaildest', emaildest);
|
||||
|
||||
// Send Msg by EMAIL
|
||||
|
||||
Reference in New Issue
Block a user