Skip to content

Commit e4eeb11

Browse files
fix: fix request reschedule - not allowing reschedule of cancelled booking (calcom#22115)
* fix: fix broken request reschdule feature * Update getServerSideProps.ts --------- Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
1 parent 3b0bb25 commit e4eeb11

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/web/lib/reschedule/[uid]/getServerSideProps.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
117117
// A booking that has been rescheduled to a new booking will also have a status of CANCELLED
118118
const isDisabledRescheduling = booking.eventType?.disableRescheduling;
119119
// This comes from query param and thus is considered forced
120-
const canRescheduleCancelledBooking =
121-
isForcedRescheduleForCancelledBooking || booking.eventType?.allowReschedulingCancelledBookings;
120+
const canBookThroughCancelledBookingRescheduleLink = booking.eventType?.allowReschedulingCancelledBookings;
122121
const isNonRescheduleableBooking =
123122
booking.status === BookingStatus.CANCELLED || booking.status === BookingStatus.REJECTED;
124123

@@ -131,8 +130,9 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
131130
};
132131
}
133132

134-
if (isNonRescheduleableBooking) {
135-
const canReschedule = booking.status === BookingStatus.CANCELLED && canRescheduleCancelledBooking;
133+
if (isNonRescheduleableBooking && !isForcedRescheduleForCancelledBooking) {
134+
const canReschedule =
135+
booking.status === BookingStatus.CANCELLED && canBookThroughCancelledBookingRescheduleLink;
136136
return {
137137
redirect: {
138138
destination: canReschedule ? eventUrl : `/booking/${uid}`,

0 commit comments

Comments
 (0)