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
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@calcom/atoms": patch
|
||||
---
|
||||
|
||||
This PR updates Booker atom to have a new prop called handleCreateRecurringBooking for handling recurring events.
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user