Deleting zoom also works
This commit is contained in:
parent
c4455b74ba
commit
49abf06ce6
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
import prisma from '../../lib/prisma';
|
import prisma from '../../lib/prisma';
|
||||||
import {deleteEvent} from "../../lib/calendarClient";
|
import {deleteEvent} from "../../lib/calendarClient";
|
||||||
import async from 'async';
|
import async from 'async';
|
||||||
|
import {deleteMeeting} from "../../lib/videoClient";
|
||||||
|
|
||||||
export default async function handler(req, res) {
|
export default async function handler(req, res) {
|
||||||
if (req.method == "POST") {
|
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 apiDeletes = async.mapLimit(bookingToDelete.user.credentials, 5, async (credential) => {
|
||||||
const bookingRefUid = bookingToDelete.references.filter((ref) => ref.type === credential.type)[0].uid;
|
const bookingRefUid = bookingToDelete.references.filter((ref) => ref.type === credential.type)[0].uid;
|
||||||
|
if(credential.type.endsWith("_calendar")) {
|
||||||
return await deleteEvent(credential, bookingRefUid);
|
return await deleteEvent(credential, bookingRefUid);
|
||||||
|
} else if(credential.type.endsWith("_video")) {
|
||||||
|
return await deleteMeeting(credential, bookingRefUid);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const attendeeDeletes = prisma.attendee.deleteMany({
|
const attendeeDeletes = prisma.attendee.deleteMany({
|
||||||
where: {
|
where: {
|
||||||
|
|
Loading…
Reference in a new issue