Moved delete request

pull/253/head
nicolas 2021-06-07 09:21:46 +02:00
parent ce8cca8a39
commit 29fef04620
1 changed files with 3 additions and 2 deletions

View File

@ -21,7 +21,7 @@ export default async function handler(req, res) {
}
});
await deleteEvent(bookingToDelete.user.credentials[0], uid);
const credentials = bookingToDelete.user.credentials[0];
await prisma.attendee.deleteMany({
where: {
@ -35,7 +35,6 @@ export default async function handler(req, res) {
}
});
//TODO Delete booking from calendar integrations
//TODO Perhaps send emails to user and client to tell about the cancellation
const deleteBooking = await prisma.booking.delete({
@ -44,6 +43,8 @@ export default async function handler(req, res) {
},
});
await deleteEvent(credentials, uid);
res.status(200).json({message: 'Booking deleted successfully'});
}
}