Skip to content

Scheduling infrastructure for absolutely everyone.

fix: HubSpot is not working for team events (#18812)

Anik Dhabal Babu35565c8f7ecc
diff --git a/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts b/packages/trpc/server/routers/viewer/bookings/confirm.handler.ts
index faaa5b91fc2..60038ddc3b2 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,