From 2f9a853023f701afef494e5f1b26111d3601438a Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Tue, 11 Mar 2025 13:04:14 +0530 Subject: [PATCH] chore: pass metadata (#19712) * chore: pass metadata * fix: type error * chore: pass videoCallUrl --- packages/embeds/embed-core/src/sdk-action-manager.ts | 1 + .../features/bookings/Booker/components/hooks/useBookings.ts | 4 +++- packages/features/bookings/lib/handleNewBooking.ts | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/embeds/embed-core/src/sdk-action-manager.ts b/packages/embeds/embed-core/src/sdk-action-manager.ts index 28d3b70924..c4ffce1d00 100644 --- a/packages/embeds/embed-core/src/sdk-action-manager.ts +++ b/packages/embeds/embed-core/src/sdk-action-manager.ts @@ -35,6 +35,7 @@ export type EventDataMap = { * This is only used for recurring bookings */ allBookings?: { startTime: string; endTime: string }[]; + videoCallUrl?: string; }; /** diff --git a/packages/features/bookings/Booker/components/hooks/useBookings.ts b/packages/features/bookings/Booker/components/hooks/useBookings.ts index 23e1ed98ab..a3b89eaa22 100644 --- a/packages/features/bookings/Booker/components/hooks/useBookings.ts +++ b/packages/features/bookings/Booker/components/hooks/useBookings.ts @@ -60,6 +60,7 @@ const getBookingSuccessfulEventPayload = (booking: { paymentRequired: boolean; uid?: string; isRecurring: boolean; + videoCallUrl?: string; }) => { return { uid: booking.uid, @@ -70,6 +71,7 @@ const getBookingSuccessfulEventPayload = (booking: { status: booking.status, paymentRequired: booking.paymentRequired, isRecurring: booking.isRecurring, + videoCallUrl: booking.videoCallUrl, }; }; @@ -262,7 +264,7 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, teamMemb isSuccessBookingPage: true, email: bookingForm.getValues("responses.email"), eventTypeSlug: eventSlug, - seatReferenceUid: "seatReferenceUid" in booking ? booking.seatReferenceUid : null, + seatReferenceUid: "seatReferenceUid" in booking ? (booking.seatReferenceUid as string) : null, formerTime: isRescheduling && bookingData?.startTime ? dayjs(bookingData.startTime).toString() : undefined, rescheduledBy, // ensure further reschedules performed on the success page are recorded correctly diff --git a/packages/features/bookings/lib/handleNewBooking.ts b/packages/features/bookings/lib/handleNewBooking.ts index d6874e55ac..4977e6926a 100644 --- a/packages/features/bookings/lib/handleNewBooking.ts +++ b/packages/features/bookings/lib/handleNewBooking.ts @@ -1838,6 +1838,9 @@ async function handler( ...booking.user, email: null, }, + videoCallUrl: metadata?.videoCallUrl, + // Ensure seatReferenceUid is properly typed as string | null + seatReferenceUid: evt.attendeeSeatId, }; return { @@ -2038,6 +2041,7 @@ async function handler( ...(isDryRun ? { troubleshooterData } : {}), references: referencesToCreate, seatReferenceUid: evt.attendeeSeatId, + videoCallUrl: metadata?.videoCallUrl, }; }