Use calendar deletion
parent
b376e9e5a4
commit
1e306ef1b0
|
@ -299,4 +299,4 @@ const deleteEvent = (credential, uid: String): Promise<any> => {
|
|||
return Promise.resolve({});
|
||||
};
|
||||
|
||||
export {getBusyTimes, createEvent, CalendarEvent};
|
||||
export {getBusyTimes, createEvent, updateEvent, deleteEvent, CalendarEvent};
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import prisma from '../../lib/prisma';
|
||||
import {createEvent, deleteEvent} from "../../lib/calendarClient";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
if (req.method == "POST") {
|
||||
|
@ -10,11 +11,14 @@ export default async function handler(req, res) {
|
|||
},
|
||||
select: {
|
||||
id: true,
|
||||
user: true,
|
||||
attendees: true,
|
||||
references: true
|
||||
}
|
||||
});
|
||||
|
||||
await deleteEvent(bookingToDelete.user.credentials[0], uid);
|
||||
|
||||
await prisma.attendee.deleteMany({
|
||||
where: {
|
||||
bookingId: bookingToDelete.id
|
||||
|
|
Loading…
Reference in New Issue