fix: hide cancel/reschedule links in emails when disabled (#27637)

When disableCancelling or disableRescheduling is enabled on an event type,
the confirmation email still showed non-functional cancel/reschedule links.

The ManageLink email component already had correct conditional logic to
hide these links, but two flows constructed the CalendarEvent manually
without including the flags: the booking confirmation handler and the
payment booking flow. This caused the flags to be undefined, which
ManageLink interpreted as enabled.

Added disableCancelling and disableRescheduling to the Prisma select and
CalendarEvent object in both confirm.handler.ts and getBooking.ts.

Closes #22906
This commit is contained in:
Everton Resende authored and GitHub committed 2026-02-10 18:57:54 -03:00
1 parent 30bba3da15
commit dc3e681e01
2 files changed
+8

No files matched your search

@@ -90,6 +90,8 @@ export async function getBooking(bookingId: number) {
},
seatsPerTimeSlot: true,
seatsShowAttendees: true,
disableCancelling: true,
disableRescheduling: true,
},
},
metadata: true,
@@ -200,6 +202,8 @@ export async function getBooking(bookingId: number) {
customReplyToEmail: booking.eventType?.customReplyToEmail,
seatsPerTimeSlot: booking.eventType?.seatsPerTimeSlot,
seatsShowAttendees: booking.eventType?.seatsShowAttendees,
disableCancelling: booking.eventType?.disableCancelling ?? false,
disableRescheduling: booking.eventType?.disableRescheduling ?? false,
};
return {
@@ -155,6 +155,8 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
hideCalendarNotes: true,
hideCalendarEventDetails: true,
disableGuests: true,
disableCancelling: true,
disableRescheduling: true,
customReplyToEmail: true,
seatsPerTimeSlot: true,
seatsShowAttendees: true,
@@ -331,6 +333,8 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
customReplyToEmail: booking.eventType?.customReplyToEmail,
seatsPerTimeSlot: booking.eventType?.seatsPerTimeSlot,
seatsShowAttendees: booking.eventType?.seatsShowAttendees,
disableCancelling: booking.eventType?.disableCancelling ?? false,
disableRescheduling: booking.eventType?.disableRescheduling ?? false,
team: booking.eventType?.team
? {
name: booking.eventType.team.name,