fix: Recurring events set to "yearly" don't recur (#24361)
* #fix: Recurring events set to “yearly” don’t recur * fix: handle yearly recurring events with explicit null check * fix: use explicit null check for recurring event frequency
This commit is contained in:
@@ -903,7 +903,7 @@ const RecurringBookingsTooltip = ({
|
||||
|
||||
return (
|
||||
(booking.recurringInfo &&
|
||||
booking.eventType?.recurringEvent?.freq &&
|
||||
booking.eventType?.recurringEvent?.freq != null &&
|
||||
(booking.listingStatus === "recurring" ||
|
||||
booking.listingStatus === "unconfirmed" ||
|
||||
booking.listingStatus === "cancelled") && (
|
||||
|
||||
@@ -34,7 +34,7 @@ export const getEveryFreqFor = ({
|
||||
recurringCount?: number;
|
||||
recurringFreq?: string;
|
||||
}): string => {
|
||||
if (recurringEvent.freq) {
|
||||
if (recurringEvent.freq != null) {
|
||||
return `${recurringFreq || getRecurringFreq({ t, recurringEvent })} ${
|
||||
recurringCount || recurringEvent.count
|
||||
} ${t("occurrence", {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { showToast } from "@calcom/ui/components/toast";
|
||||
import { getUtmTrackingParameters } from "../../lib/getUtmTrackingParameters";
|
||||
import type { UseCreateBookingInput } from "./useCreateBooking";
|
||||
|
||||
type Callbacks = { onSuccess?: () => void; onError?: (err: any) => void };
|
||||
type Callbacks = { onSuccess?: () => void; onError?: (err: unknown) => void };
|
||||
type UseHandleBookingProps = {
|
||||
bookingForm: UseBookingFormReturnType["bookingForm"];
|
||||
event?: {
|
||||
@@ -64,8 +64,8 @@ export const useHandleBookEvent = ({
|
||||
const crmAppSlug = useBookerStoreContext((state) => state.crmAppSlug);
|
||||
const crmRecordId = useBookerStoreContext((state) => state.crmRecordId);
|
||||
const verificationCode = useBookerStoreContext((state) => state.verificationCode);
|
||||
const handleError = (err: any) => {
|
||||
const errorMessage = err?.message ? t(err.message) : t("can_you_try_again");
|
||||
const handleError = (err: unknown) => {
|
||||
const errorMessage = err instanceof Error ? t(err.message) : t("can_you_try_again");
|
||||
showToast(errorMessage, "error");
|
||||
};
|
||||
const searchParams = useSearchParams();
|
||||
@@ -121,7 +121,7 @@ export const useHandleBookEvent = ({
|
||||
|
||||
if (isInstantMeeting) {
|
||||
handleInstantBooking(mapBookingToMutationInput(bookingInput), callbacks);
|
||||
} else if (event.data?.recurringEvent?.freq && recurringEventCount && !rescheduleUid) {
|
||||
} else if (event.data?.recurringEvent?.freq != null && recurringEventCount && !rescheduleUid) {
|
||||
handleRecBooking(
|
||||
mapRecurringBookingToMutationInput(bookingInput, recurringEventCount, tracking),
|
||||
callbacks
|
||||
|
||||
Reference in New Issue
Block a user