Scheduling infrastructure for absolutely everyone.
Deleting zoom also works
nicolas49abf06ce665
diff --git a/pages/api/cancel.ts b/pages/api/cancel.tsindex 4c6a31f9cda..90ef2f43eb9 100644--- a/pages/api/cancel.ts+++ b/pages/api/cancel.ts@@ -1,6 +1,7 @@import prisma from '../../lib/prisma';import {deleteEvent} from "../../lib/calendarClient";import async from 'async';+import {deleteMeeting} from "../../lib/videoClient";export default async function handler(req, res) {if (req.method == "POST") {@@ -29,7 +30,11 @@ export default async function handler(req, res) {const apiDeletes = async.mapLimit(bookingToDelete.user.credentials, 5, async (credential) => {const bookingRefUid = bookingToDelete.references.filter((ref) => ref.type === credential.type)[0].uid;- return await deleteEvent(credential, bookingRefUid);+ if(credential.type.endsWith("_calendar")) {+ return await deleteEvent(credential, bookingRefUid);+ } else if(credential.type.endsWith("_video")) {+ return await deleteMeeting(credential, bookingRefUid);+ }});const attendeeDeletes = prisma.attendee.deleteMany({where: {