- Message notify when 'Ask Info' and user is not logged

- Ask Info and Book show message if not logged
- TableField fixed and added some features
This commit is contained in:
Paolo Arena
2019-11-04 20:30:09 +01:00
parent f787fd3cea
commit 9205468065
9 changed files with 90 additions and 16 deletions

View File

@@ -16,6 +16,7 @@ const { Operator } = require('../models/operator');
const { Where } = require('../models/where');
const { MyEvent } = require('../models/myevent');
const { Contribtype } = require('../models/contribtype');
const { Settings } = require('../models/settings');
const { SendMsg } = require('../models/sendmsg');
const { Permission } = require('../models/permission');
@@ -142,6 +143,8 @@ function getTableByTableName(tablename) {
mytable = MyEvent;
else if (tablename === 'contribtype')
mytable = Contribtype;
else if (tablename === 'settings')
mytable = Settings;
else if (tablename === 'permissions')
mytable = Permission;
@@ -336,10 +339,11 @@ router.get('/loadsite/:userId/:idapp/:sall', authenticate_noerror, (req, res) =>
const operators = Operator.findAllIdApp(idapp);
const wheres = Where.findAllIdApp(idapp);
const contribtype = Contribtype.findAllIdApp(idapp);
const settings = Settings.findAllIdApp(idapp);
const permissions = Permission.findAllIdApp();
return Promise.all([bookedevent, eventlist, operators, wheres, contribtype, permissions])
return Promise.all([bookedevent, eventlist, operators, wheres, contribtype, settings, permissions])
.then((arrdata) => {
// console.table(arrdata);
res.send({
@@ -348,7 +352,8 @@ router.get('/loadsite/:userId/:idapp/:sall', authenticate_noerror, (req, res) =>
operators: arrdata[2],
wheres: arrdata[3],
contribtype: arrdata[4],
permissions: arrdata[5],
settings: arrdata[5],
permissions: arrdata[6],
});
})
.catch((e) => {

View File

@@ -57,7 +57,7 @@ router.post('/', authenticate, (req, res) => {
return SendMsg.findById(idobj)
.then((recmsg) => {
// Add this field because I don't want to add into the database
recmsg.origin.infoevent = body.origin.infoevent;
recmsg.source.infoevent = body.source.infoevent;
return sendNotif(res, body.idapp, req.user, recmsg).then((ris) => {
return res.send({ code: server_constants.RIS_CODE_OK, msg: '', id: recmsg._id });