Use calendar deletion

pull/253/head
nicolas 2021-06-07 08:59:13 +02:00
parent b376e9e5a4
commit 1e306ef1b0
2 changed files with 5 additions and 1 deletions

View File

@ -299,4 +299,4 @@ const deleteEvent = (credential, uid: String): Promise<any> => {
return Promise.resolve({}); return Promise.resolve({});
}; };
export {getBusyTimes, createEvent, CalendarEvent}; export {getBusyTimes, createEvent, updateEvent, deleteEvent, CalendarEvent};

View File

@ -1,4 +1,5 @@
import prisma from '../../lib/prisma'; import prisma from '../../lib/prisma';
import {createEvent, deleteEvent} from "../../lib/calendarClient";
export default async function handler(req, res) { export default async function handler(req, res) {
if (req.method == "POST") { if (req.method == "POST") {
@ -10,11 +11,14 @@ export default async function handler(req, res) {
}, },
select: { select: {
id: true, id: true,
user: true,
attendees: true, attendees: true,
references: true references: true
} }
}); });
await deleteEvent(bookingToDelete.user.credentials[0], uid);
await prisma.attendee.deleteMany({ await prisma.attendee.deleteMany({
where: { where: {
bookingId: bookingToDelete.id bookingId: bookingToDelete.id