From e4eeb11a61f0460928b2cf7cfd403798d30d664a Mon Sep 17 00:00:00 2001 From: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Date: Mon, 30 Jun 2025 15:26:45 +0530 Subject: [PATCH] fix: fix request reschedule - not allowing reschedule of cancelled booking (#22115) * fix: fix broken request reschdule feature * Update getServerSideProps.ts --------- Co-authored-by: Hariom Balhara --- apps/web/lib/reschedule/[uid]/getServerSideProps.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/lib/reschedule/[uid]/getServerSideProps.ts b/apps/web/lib/reschedule/[uid]/getServerSideProps.ts index c6036c2050..4267076416 100644 --- a/apps/web/lib/reschedule/[uid]/getServerSideProps.ts +++ b/apps/web/lib/reschedule/[uid]/getServerSideProps.ts @@ -117,8 +117,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { // A booking that has been rescheduled to a new booking will also have a status of CANCELLED const isDisabledRescheduling = booking.eventType?.disableRescheduling; // This comes from query param and thus is considered forced - const canRescheduleCancelledBooking = - isForcedRescheduleForCancelledBooking || booking.eventType?.allowReschedulingCancelledBookings; + const canBookThroughCancelledBookingRescheduleLink = booking.eventType?.allowReschedulingCancelledBookings; const isNonRescheduleableBooking = booking.status === BookingStatus.CANCELLED || booking.status === BookingStatus.REJECTED; @@ -131,8 +130,9 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { }; } - if (isNonRescheduleableBooking) { - const canReschedule = booking.status === BookingStatus.CANCELLED && canRescheduleCancelledBooking; + if (isNonRescheduleableBooking && !isForcedRescheduleForCancelledBooking) { + const canReschedule = + booking.status === BookingStatus.CANCELLED && canBookThroughCancelledBookingRescheduleLink; return { redirect: { destination: canReschedule ? eventUrl : `/booking/${uid}`,