- fix: La partecipazione agli eventi, non viene salvata correttamente e non visualizzava.
This commit is contained in:
@@ -45,7 +45,7 @@ router.post('/', authenticate, (req, res) => {
|
||||
// console.log('trovato', trovato);
|
||||
if (trovato) {
|
||||
return Booking.findOneAndUpdate({ id_bookedevent: id }, { $set: fieldtochange }, {
|
||||
new: false,
|
||||
new: true,
|
||||
upsert: true
|
||||
}).then((recbooking) => {
|
||||
// tools.mylog('booking:', booking);
|
||||
@@ -79,7 +79,7 @@ router.delete('/:id/:notify/:idapp', authenticate, (req, res) => {
|
||||
const notify = req.params.notify;
|
||||
const idapp = req.params.idapp;
|
||||
|
||||
Booking.deleteOne({_id: id}).then((recbooking) => {
|
||||
Booking.findOneAndDelete({_id: id}).then((recbooking) => {
|
||||
if (!recbooking) {
|
||||
return res.status(404).send();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user