Add videoCallData to evt on new attendee (#6673)

* Add videoCallData to evt on new attendee

* Remove console.log
pull/6691/head
Joe Au-Yeung 2023-01-25 03:52:58 -05:00 committed by GitHub
parent 3a8aa26c78
commit 00bff598ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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,