From da7c5ec407e07c8f5db0dbfee4f0efc9fdc3f639 Mon Sep 17 00:00:00 2001 From: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com> Date: Mon, 25 Mar 2024 23:15:23 -0400 Subject: [PATCH] fix: Fixes Jelly type mismatch and passes conference credential id when confirm bookings (#14209) * On confirmation get the conference credential id * Fix misconfigured location type --------- Co-authored-by: Bailey Pumfleet --- packages/app-store/jelly/config.json | 2 +- .../server/routers/viewer/bookings/confirm.handler.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/app-store/jelly/config.json b/packages/app-store/jelly/config.json index 7893b9cf66..68433dcbf6 100644 --- a/packages/app-store/jelly/config.json +++ b/packages/app-store/jelly/config.json @@ -11,7 +11,7 @@ "email": "support@jellyjelly.com", "appData": { "location": { - "type": "integrations:{SLUG}_video", + "type": "integrations:{SLUG}_conferencing", "label": "{TITLE}", "linkType": "dynamic" } diff --git a/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts b/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts index 5d632951c4..4e35c5f157 100644 --- a/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts +++ b/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts @@ -1,6 +1,8 @@ import { Prisma } from "@prisma/client"; import appStore from "@calcom/app-store"; +import { getLocationValueForDB } from "@calcom/app-store/locations"; +import type { LocationObject } from "@calcom/app-store/locations"; import { sendDeclinedEmails } from "@calcom/emails"; import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses"; import { handleConfirmation } from "@calcom/features/bookings/lib/handleConfirmation"; @@ -67,6 +69,7 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => { bookingFields: true, disableGuests: true, metadata: true, + locations: true, team: { select: { parentId: true, @@ -248,6 +251,11 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => { ...user, credentials, }; + const conferenceCredentialId = getLocationValueForDB( + booking.location ?? "", + (booking.eventType?.locations as LocationObject[]) || [] + ); + evt.conferenceCredentialId = conferenceCredentialId.conferenceCredentialId; await handleConfirmation({ user: userWithCredentials, evt,