Scheduling infrastructure for absolutely everyone.
fix: fix request reschedule - not allowing reschedule of cancelled booking (#22115)
Anik Dhabal Babue4eeb11a61f0
diff --git a/apps/web/lib/reschedule/[uid]/getServerSideProps.ts b/apps/web/lib/reschedule/[uid]/getServerSideProps.tsindex c6036c2050d..4267076416c 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 CANCELLEDconst 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}`,