Deleting zoom also works
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user