fix: ensure isBookingDryRun prop works for booking creation (#22182)

* fix: ensure isBookingDryRun prop works for booking creation

- Add isBookingDryRun prop to useHandleBookEvent hook
- Pass prop through BookerPlatformWrapper and useBookings
- Override _isDryRun flag when prop is provided
- Fixes issue where dry run banner showed but booking creation ignored prop

Co-Authored-By: [email protected] <[email protected]>

* fixup

* if dry run prop is pass we use that, otherwise we use params

* add changesets for PR

* replace minor with patch changeset

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: Ryukemeister <[email protected]>
Co-authored-by: Rajiv Sahal <[email protected]>
Co-authored-by: Morgan <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-07-11 16:45:30 +00:00
1 parent 94a537bfda
commit 8b3ff0b789
5 files changed
+23 -3

No files matched your search

@@ -353,7 +353,7 @@ export const BookerPlatformWrapper = (
onReserveSlotError: props.onReserveSlotError,
onDeleteSlotSuccess: props.onDeleteSlotSuccess,
onDeleteSlotError: props.onDeleteSlotError,
isBookingDryRun: routingParams?.isBookingDryRun,
isBookingDryRun: props.isBookingDryRun ? props.isBookingDryRun : routingParams?.isBookingDryRun,
handleSlotReservation,
});
@@ -393,6 +393,7 @@ export const BookerPlatformWrapper = (
handleRecBooking: createRecBooking,
locationUrl: props.locationUrl,
routingFormSearchParams,
isBookingDryRun: isBookingDryRun ?? routingParams?.isBookingDryRun,
});
const onOverlaySwitchStateChange = useCallback(
@@ -30,6 +30,7 @@ type UseHandleBookingProps = {
handleRecBooking: (input: BookingCreateBody[], callbacks?: Callbacks) => void;
locationUrl?: string;
routingFormSearchParams?: RoutingFormSearchParams;
isBookingDryRun?: boolean;
};
export const useHandleBookEvent = ({
@@ -42,6 +43,7 @@ export const useHandleBookEvent = ({
handleRecBooking,
locationUrl,
routingFormSearchParams,
isBookingDryRun,
}: UseHandleBookingProps) => {
const isPlatform = useIsPlatform();
const setFormValues = useBookerStore((state) => state.setFormValues);
@@ -108,6 +110,7 @@ export const useHandleBookEvent = ({
crmAppSlug,
orgSlug: orgSlug ? orgSlug : undefined,
routingFormSearchParams,
isDryRunProp: isBookingDryRun,
};
const tracking = getUtmTrackingParameters(searchParams);