From 35565c8f7ecc5fd866b45c83e87815b268f920bb Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Thu, 23 Jan 2025 02:10:34 +0530 Subject: [PATCH] fix: HubSpot is not working for team events (#18812) * fix: hubspot is not working for team events * update --- .../trpc/server/routers/viewer/bookings/confirm.handler.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts b/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts index faaa5b91fc..60038ddc3b 100644 --- a/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts +++ b/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts @@ -3,6 +3,7 @@ import { Prisma } from "@prisma/client"; import type { LocationObject } from "@calcom/app-store/locations"; import { getLocationValueForDB } from "@calcom/app-store/locations"; import { sendDeclinedEmailsAndSMS } from "@calcom/emails"; +import { getAllCredentials } from "@calcom/features/bookings/lib/getAllCredentialsForUsersOnEvent/getAllCredentials"; import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses"; import { handleConfirmation } from "@calcom/features/bookings/lib/handleConfirmation"; import { handleWebhookTrigger } from "@calcom/features/bookings/lib/handleWebhookTrigger"; @@ -265,13 +266,17 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => { ...user, credentials, }; + const allCredentials = await getAllCredentials(userWithCredentials, { + ...booking.eventType, + metadata: booking.eventType?.metadata as EventTypeMetadata, + }); const conferenceCredentialId = getLocationValueForDB( booking.location ?? "", (booking.eventType?.locations as LocationObject[]) || [] ); evt.conferenceCredentialId = conferenceCredentialId.conferenceCredentialId; await handleConfirmation({ - user: userWithCredentials, + user: { ...user, credentials: allCredentials }, evt, recurringEventId, prisma,