Skip to content

Commit e47ddf9

Browse files
authored
chore: add handleCreateRecurringBooking prop to booker atom (calcom#24786)
* chore: update Booker platform wrapper props * fix: pass handle create recurring prop to useHandleBookEvent if prop present * chore: add changesets
1 parent 08c62b5 commit e47ddf9

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

.changeset/all-dogs-flow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@calcom/atoms": patch
3+
---
4+
5+
This PR updates Booker atom to have a new prop called handleCreateRecurringBooking for handling recurring events.

packages/platform/atoms/booker/BookerPlatformWrapper.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable react-hooks/exhaustive-deps */
22
import { useQueryClient } from "@tanstack/react-query";
3-
43
import debounce from "lodash/debounce";
54
import { useMemo, useEffect, useCallback, useState, useRef, useContext } from "react";
65
import { shallow } from "zustand/shallow";
@@ -442,7 +441,7 @@ const BookerPlatformWrapperComponent = (
442441
metadata: props.metadata ?? {},
443442
handleBooking: props?.handleCreateBooking ?? createBooking,
444443
handleInstantBooking: createInstantBooking,
445-
handleRecBooking: createRecBooking,
444+
handleRecBooking: props?.handleCreateRecurringBooking ?? createRecBooking,
446445
locationUrl: props.locationUrl,
447446
routingFormSearchParams,
448447
isBookingDryRun: isBookingDryRun ?? routingParams?.isBookingDryRun,

packages/platform/atoms/booker/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type React from "react";
33
import type { BookerProps } from "@calcom/features/bookings/Booker";
44
import type { BookerStore } from "@calcom/features/bookings/Booker/store";
55
import type { Timezone, VIEW_TYPE } from "@calcom/features/bookings/Booker/types";
6+
import type { BookingCreateBody } from "@calcom/features/bookings/lib/bookingCreateBodySchema";
67
import type { BookingResponse } from "@calcom/platform-libraries";
78
import type {
89
ApiSuccessResponse,
@@ -57,6 +58,7 @@ export type BookerPlatformWrapperAtomProps = Omit<
5758
rescheduleReason?: string;
5859
} & Record<string, string | string[]>;
5960
handleCreateBooking?: (input: UseCreateBookingInput) => void;
61+
handleCreateRecurringBooking?: (input: BookingCreateBody[]) => void;
6062
onCreateBookingSuccess?: (data: ApiSuccessResponse<BookingResponse>) => void;
6163
onCreateBookingError?: (data: ApiErrorResponse | Error) => void;
6264
onCreateRecurringBookingSuccess?: (data: ApiSuccessResponse<BookingResponse[]>) => void;

0 commit comments

Comments
 (0)