From 00bff598efb00cfb91424129ccdedbbb9fc719d5 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Wed, 25 Jan 2023 03:52:58 -0500 Subject: [PATCH] Add videoCallData to evt on new attendee (#6673) * Add videoCallData to evt on new attendee * Remove console.log --- packages/features/bookings/lib/handleNewBooking.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.ts index 0a2d292d3d..fa389846ec 100644 --- a/packages/features/bookings/lib/handleNewBooking.ts +++ b/packages/features/bookings/lib/handleNewBooking.ts @@ -593,6 +593,16 @@ async function handler(req: NextApiRequest & { userId?: number | undefined }) { throw new HttpError({ statusCode: 409, message: "Already signed up for time slot" }); } + const videoCallReference = booking.references.find((reference) => reference.type.includes("_video")); + + if (videoCallReference) { + evt.videoCallData = { + type: videoCallReference.type, + id: videoCallReference.meetingId, + password: videoCallReference?.meetingPassword, + url: videoCallReference.meetingUrl, + }; + } await prisma.booking.update({ where: { uid: reqBody.bookingUid,