Skip to content

Scheduling infrastructure for absolutely everyone.

chore: add `handleCreateRecurringBooking` prop to booker atom (#24786)

Rajiv Sahale47ddf983559
diff --git a/.changeset/all-dogs-flow.md b/.changeset/all-dogs-flow.md
new file mode 100644
index 00000000000..ffcd041ccd6
--- /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 ae5fbffc4aa..f3670b38f7b 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 56bf9c65505..8ef1e9758bc 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<string, string | string[]>;
handleCreateBooking?: (input: UseCreateBookingInput) => void;
+ handleCreateRecurringBooking?: (input: BookingCreateBody[]) => void;
onCreateBookingSuccess?: (data: ApiSuccessResponse<BookingResponse>) => void;
onCreateBookingError?: (data: ApiErrorResponse | Error) => void;
onCreateRecurringBookingSuccess?: (data: ApiSuccessResponse<BookingResponse[]>) => void;