- Delete Event with ask confirmation
- Fix dateStart only 1 view if is the same day - Sending a message from the Event Page: to a user or to a "Event" - Add button "Ask Info" - Starting view msg into the messagepopup component
This commit is contained in:
@@ -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 { SendMsg } = require('../models/sendmsg');
|
||||
|
||||
|
||||
const tools = require('../tools/general');
|
||||
@@ -86,42 +87,6 @@ router.post(process.env.LINK_REQUEST_NEWPASSWORD, (req, res) => {
|
||||
});
|
||||
|
||||
|
||||
router.get(process.env.LINK_CHECK_UPDATES, authenticate, (req, res) => {
|
||||
const userId = req.user._id;
|
||||
|
||||
// console.log("POST " + process.env.LINK_CHECK_UPDATES + " userId=" + userId);
|
||||
|
||||
if (!ObjectID.isValid(userId)) {
|
||||
return res.status(404).send();
|
||||
}
|
||||
|
||||
cfgserver.find().then((arrcfgrec) => {
|
||||
|
||||
if (!arrcfgrec)
|
||||
return res.status(404).send();
|
||||
|
||||
// ++Todo: Add to Log Stat ....
|
||||
|
||||
if (req.user) {
|
||||
// If User is Admin, then send user Lists
|
||||
if (User.isAdmin(req.user)) {
|
||||
// Send UsersList
|
||||
return User.getUsersList(req.user.idapp).then(usersList => {
|
||||
return res.send({ cfgServer: arrcfgrec, usersList });
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
res.send({ cfgServer: arrcfgrec });
|
||||
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
res.status(400).send({ code: server_constants.RIS_CODE_ERR, msg: e });
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Invio la Nuova Password richiesta dal reset!
|
||||
// Ritorna il token per poter effettuare le chiamate...
|
||||
router.post(process.env.LINK_UPDATE_PASSWORD, (req, res) => {
|
||||
@@ -165,6 +130,8 @@ function getTableByTableName(tablename) {
|
||||
mytable = Booking;
|
||||
else if (tablename === 'operators')
|
||||
mytable = Operator;
|
||||
else if (tablename === 'sendmsgs')
|
||||
mytable = SendMsg;
|
||||
else if (tablename === 'wheres')
|
||||
mytable = Where;
|
||||
else if (tablename === 'myevents')
|
||||
@@ -335,9 +302,10 @@ router.get('/loadsite/:userId/:idapp/:sall', authenticate_noerror, (req, res) =>
|
||||
const sall = req.params.sall;
|
||||
// var category = req.params.category;
|
||||
|
||||
tools.mylog('loadsite : ', req.params);
|
||||
// tools.mylog('loadsite : ', req.params);
|
||||
|
||||
let bookedevent = [];
|
||||
let msgs = [];
|
||||
|
||||
if (userId !== '0') {
|
||||
// LOGGED WITH USERID
|
||||
@@ -350,10 +318,16 @@ router.get('/loadsite/:userId/:idapp/:sall', authenticate_noerror, (req, res) =>
|
||||
const wheres = Where.findAllIdApp(idapp);
|
||||
const contribtype = Contribtype.findAllIdApp(idapp);
|
||||
|
||||
return Promise.all([bookedevent, eventlist, operators, wheres, contribtype])
|
||||
return Promise.all([bookedevent, eventlist, operators, wheres, contribtype, msgs])
|
||||
.then((arrdata) => {
|
||||
console.table(arrdata);
|
||||
res.send({ bookedevent: arrdata[0], eventlist: arrdata[1], operators: arrdata[2], wheres: arrdata[3], contribtype: arrdata[4] });
|
||||
// console.table(arrdata);
|
||||
res.send({
|
||||
bookedevent: arrdata[0],
|
||||
eventlist: arrdata[1],
|
||||
operators: arrdata[2],
|
||||
wheres: arrdata[3],
|
||||
contribtype: arrdata[4],
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
@@ -362,5 +336,52 @@ router.get('/loadsite/:userId/:idapp/:sall', authenticate_noerror, (req, res) =>
|
||||
|
||||
});
|
||||
|
||||
router.get(process.env.LINK_CHECK_UPDATES, authenticate, (req, res) => {
|
||||
const userId = req.user._id;
|
||||
|
||||
// console.log("POST " + process.env.LINK_CHECK_UPDATES + " userId=" + userId);
|
||||
|
||||
if (!ObjectID.isValid(userId)) {
|
||||
return res.status(404).send();
|
||||
}
|
||||
|
||||
cfgserver.find().then((arrcfgrec) => {
|
||||
|
||||
if (!arrcfgrec)
|
||||
return res.status(404).send();
|
||||
|
||||
// ++Todo: Add to Log Stat ....
|
||||
|
||||
// const sall = '0';
|
||||
|
||||
msgs = SendMsg.findAllByUserIdAndIdApp(userId, req.user.username, req.user.idapp);
|
||||
|
||||
let usersList = null;
|
||||
|
||||
if (req.user) {
|
||||
// If User is Admin, then send user Lists
|
||||
if (User.isAdmin(req.user)) {
|
||||
// Send UsersList
|
||||
usersList = User.getUsersList(req.user.idapp)
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.all([usersList, msgs])
|
||||
.then((arrdata) => {
|
||||
// console.table(arrdata);
|
||||
return res.send({
|
||||
cfgServer: arrcfgrec,
|
||||
usersList: arrdata[0],
|
||||
msgs: arrdata[1],
|
||||
});
|
||||
});
|
||||
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
res.status(400).send({ code: server_constants.RIS_CODE_ERR, msg: e });
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user