- Enable Edit Event into dialog form ... (and save to the db)
- Event: enabled drag and drop (date) - Q-Select components in every table field external: Where, Operators, etc... - CMyEditor: Add HTML Editor to the details field ! - Added button Color for change font color to the text. - Complete insert Events Site
This commit is contained in:
@@ -10,6 +10,7 @@ const { Booking } = require('../models/booking');
|
||||
const { MyEvent } = require('../models/myevent');
|
||||
const { Operator } = require('../models/operator');
|
||||
const { Where } = require('../models/where');
|
||||
const { Contribtype } = require('../models/contribtype');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
@@ -97,45 +98,41 @@ router.delete('/:id/:notify/:idapp', authenticate, (req, res) => {
|
||||
});
|
||||
|
||||
|
||||
router.get('/:userId/:idapp/:sall', authenticate, (req, res) => {
|
||||
const userId = req.params.userId;
|
||||
const idapp = req.params.idapp;
|
||||
const sall = req.params.sall;
|
||||
// var category = req.params.category;
|
||||
|
||||
// tools.mylog('GET BOOKINGS : ', req.params);
|
||||
|
||||
if (!ObjectID.isValid(userId)) {
|
||||
return res.status(404).send();
|
||||
}
|
||||
|
||||
if (userId !== String(req.user._id)) {
|
||||
// I'm trying to write something not mine!
|
||||
return res.status(404).send({ code: server_constants.RIS_CODE_TODO_CREATING_NOTMYUSER });
|
||||
}
|
||||
|
||||
// Extract all the todos of the userId only
|
||||
Booking.findAllByUserIdAndIdApp(userId, idapp, sall).then((bookedevent) => {
|
||||
|
||||
return MyEvent.findAllIdApp(idapp)
|
||||
.then((eventlist) => {
|
||||
return Operator.findAllIdApp(idapp)
|
||||
.then((operators) => {
|
||||
|
||||
return Where.findAllIdApp(idapp)
|
||||
.then((wheres) => {
|
||||
|
||||
res.send({ bookedevent, eventlist, operators, wheres });
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
}).catch((e) => {
|
||||
console.log(e);
|
||||
res.status(400).send(e);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// router.get('/:userId/:idapp/:sall', authenticate, (req, res) => {
|
||||
// const userId = req.params.userId;
|
||||
// const idapp = req.params.idapp;
|
||||
// const sall = req.params.sall;
|
||||
// // var category = req.params.category;
|
||||
//
|
||||
// // tools.mylog('GET BOOKINGS : ', req.params);
|
||||
//
|
||||
// if (!ObjectID.isValid(userId)) {
|
||||
// return res.status(404).send();
|
||||
// }
|
||||
//
|
||||
// if (userId !== String(req.user._id)) {
|
||||
// // I'm trying to write something not mine!
|
||||
// return res.status(404).send({ code: server_constants.RIS_CODE_TODO_CREATING_NOTMYUSER });
|
||||
// }
|
||||
//
|
||||
// // Extract all the todos of the userId only
|
||||
// const bookedevent = Booking.findAllByUserIdAndIdApp(userId, idapp, sall);
|
||||
// const eventlist = MyEvent.findAllIdApp(idapp);
|
||||
// const operators = Operator.findAllIdApp(idapp);
|
||||
// const wheres = Where.findAllIdApp(idapp);
|
||||
// const contribtype = Contribtype.findAllIdApp(idapp);
|
||||
//
|
||||
// return Promise.all([bookedevent, eventlist, operators, wheres, contribtype])
|
||||
// .then((arrdata) => {
|
||||
// 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);
|
||||
// res.status(400).send(e);
|
||||
// });
|
||||
//
|
||||
// });
|
||||
//
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user