fix: rescheduling recurring events (#12567)
This commit is contained in:
parent
338756439f
commit
1c20bdcecf
|
@ -525,8 +525,8 @@ const RecurringBookingsTooltip = ({
|
|||
return (
|
||||
recurringDate >= now &&
|
||||
!booking.recurringInfo?.bookings[BookingStatus.CANCELLED]
|
||||
.map((date) => date.toDateString())
|
||||
.includes(recurringDate.toDateString())
|
||||
.map((date) => date.toString())
|
||||
.includes(recurringDate.toString())
|
||||
);
|
||||
}).length;
|
||||
|
||||
|
@ -543,8 +543,8 @@ const RecurringBookingsTooltip = ({
|
|||
const pastOrCancelled =
|
||||
aDate < now ||
|
||||
booking.recurringInfo?.bookings[BookingStatus.CANCELLED]
|
||||
.map((date) => date.toDateString())
|
||||
.includes(aDate.toDateString());
|
||||
.map((date) => date.toString())
|
||||
.includes(aDate.toString());
|
||||
return (
|
||||
<p key={key} className={classNames(pastOrCancelled && "line-through")}>
|
||||
{formatTime(aDate, userTimeFormat, userTimeZone)}
|
||||
|
|
|
@ -1244,6 +1244,7 @@ async function getRecurringBookings(recurringEventId: string | null) {
|
|||
const recurringBookings = await prisma.booking.findMany({
|
||||
where: {
|
||||
recurringEventId,
|
||||
status: BookingStatus.ACCEPTED,
|
||||
},
|
||||
select: {
|
||||
startTime: true,
|
||||
|
|
|
@ -344,7 +344,7 @@ export const BookEventFormChild = ({
|
|||
hashedLink,
|
||||
};
|
||||
|
||||
if (eventQuery.data?.recurringEvent?.freq && recurringEventCount) {
|
||||
if (eventQuery.data?.recurringEvent?.freq && recurringEventCount && !rescheduleUid) {
|
||||
createRecurringBookingMutation.mutate(
|
||||
mapRecurringBookingToMutationInput(bookingInput, recurringEventCount)
|
||||
);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Fragment } from "react";
|
||||
import React from "react";
|
||||
|
||||
import { useBookerStore } from "@calcom/features/bookings/Booker/store";
|
||||
import classNames from "@calcom/lib/classNames";
|
||||
import getPaymentAppData from "@calcom/lib/getPaymentAppData";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
@ -110,6 +111,7 @@ export const EventMetaBlock = ({
|
|||
*/
|
||||
export const EventDetails = ({ event, blocks = defaultEventDetailsBlocks }: EventDetailsProps) => {
|
||||
const { t } = useLocale();
|
||||
const rescheduleUid = useBookerStore((state) => state.rescheduleUid);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -144,7 +146,7 @@ export const EventDetails = ({ event, blocks = defaultEventDetailsBlocks }: Even
|
|||
);
|
||||
|
||||
case EventDetailBlocks.OCCURENCES:
|
||||
if (!event.recurringEvent) return null;
|
||||
if (!event.recurringEvent || rescheduleUid) return null;
|
||||
|
||||
return (
|
||||
<EventMetaBlock key={block} icon={RefreshCcw}>
|
||||
|
|
Loading…
Reference in New Issue
Block a user