|
|
@@ -47,7 +47,7 @@ router.post('/create', function(req, res, next) {
|
|
|
const newTask = new Appointment({ user, title, description, dueDate, place, startDate, endDate });
|
|
|
|
|
|
newTask.save()
|
|
|
- .then(doc => res.json({ "id": `${doc._id}` }))
|
|
|
+ .then(doc => res.json({ "id": doc._id }))
|
|
|
.catch(err => res.status(500).json({ 'message': err }));
|
|
|
|
|
|
});
|
|
|
@@ -71,7 +71,7 @@ router.post('/modify', function (req, res, next) {
|
|
|
.then(result => {
|
|
|
if (result.modifiedCount === 1) {
|
|
|
console.log("Successfully updated the document.");
|
|
|
- res.json({ "success": true });
|
|
|
+ res.json({ "id": appointmentId });
|
|
|
} else {
|
|
|
console.log("Document not updated");
|
|
|
res.status(500).json({ 'message': 'Document has not changed' });
|