From e47ddf983559816ab7ce9789eee97254124b1a4c Mon Sep 17 00:00:00 2001 From: Rajiv Sahal Date: Thu, 30 Oct 2025 16:50:17 +0100 Subject: [PATCH] chore: add `handleCreateRecurringBooking` prop to booker atom (#24786) * chore: update Booker platform wrapper props * fix: pass handle create recurring prop to useHandleBookEvent if prop present * chore: add changesets --- .changeset/all-dogs-flow.md | 5 +++++ packages/platform/atoms/booker/BookerPlatformWrapper.tsx | 3 +-- packages/platform/atoms/booker/types.ts | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/all-dogs-flow.md diff --git a/.changeset/all-dogs-flow.md b/.changeset/all-dogs-flow.md new file mode 100644 index 0000000000..ffcd041ccd --- /dev/null +++ b/.changeset/all-dogs-flow.md @@ -0,0 +1,5 @@ +--- +"@calcom/atoms": patch +--- + +This PR updates Booker atom to have a new prop called handleCreateRecurringBooking for handling recurring events. diff --git a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx index ae5fbffc4a..f3670b38f7 100644 --- a/packages/platform/atoms/booker/BookerPlatformWrapper.tsx +++ b/packages/platform/atoms/booker/BookerPlatformWrapper.tsx @@ -1,6 +1,5 @@ /* eslint-disable react-hooks/exhaustive-deps */ import { useQueryClient } from "@tanstack/react-query"; - import debounce from "lodash/debounce"; import { useMemo, useEffect, useCallback, useState, useRef, useContext } from "react"; import { shallow } from "zustand/shallow"; @@ -442,7 +441,7 @@ const BookerPlatformWrapperComponent = ( metadata: props.metadata ?? {}, handleBooking: props?.handleCreateBooking ?? createBooking, handleInstantBooking: createInstantBooking, - handleRecBooking: createRecBooking, + handleRecBooking: props?.handleCreateRecurringBooking ?? createRecBooking, locationUrl: props.locationUrl, routingFormSearchParams, isBookingDryRun: isBookingDryRun ?? routingParams?.isBookingDryRun, diff --git a/packages/platform/atoms/booker/types.ts b/packages/platform/atoms/booker/types.ts index 56bf9c6550..8ef1e9758b 100644 --- a/packages/platform/atoms/booker/types.ts +++ b/packages/platform/atoms/booker/types.ts @@ -3,6 +3,7 @@ import type React from "react"; import type { BookerProps } from "@calcom/features/bookings/Booker"; import type { BookerStore } from "@calcom/features/bookings/Booker/store"; import type { Timezone, VIEW_TYPE } from "@calcom/features/bookings/Booker/types"; +import type { BookingCreateBody } from "@calcom/features/bookings/lib/bookingCreateBodySchema"; import type { BookingResponse } from "@calcom/platform-libraries"; import type { ApiSuccessResponse, @@ -57,6 +58,7 @@ export type BookerPlatformWrapperAtomProps = Omit< rescheduleReason?: string; } & Record; handleCreateBooking?: (input: UseCreateBookingInput) => void; + handleCreateRecurringBooking?: (input: BookingCreateBody[]) => void; onCreateBookingSuccess?: (data: ApiSuccessResponse) => void; onCreateBookingError?: (data: ApiErrorResponse | Error) => void; onCreateRecurringBookingSuccess?: (data: ApiSuccessResponse) => void;