fix: handle reschedule request for dynamic meetings (#12275)
This commit is contained in:
parent
9ca2ad2d41
commit
d13dedda9a
|
@ -80,7 +80,7 @@ export const requestRescheduleHandler = async ({ ctx, input }: RequestReschedule
|
||||||
throw new TRPCError({ code: "FORBIDDEN", message: "Booking to reschedule doesn't have an owner" });
|
throw new TRPCError({ code: "FORBIDDEN", message: "Booking to reschedule doesn't have an owner" });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bookingToReschedule.eventType) {
|
if (!bookingToReschedule.eventType && !bookingToReschedule.dynamicEventSlugRef) {
|
||||||
throw new TRPCError({ code: "FORBIDDEN", message: "EventType not found for current booking." });
|
throw new TRPCError({ code: "FORBIDDEN", message: "EventType not found for current booking." });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ export const requestRescheduleHandler = async ({ ctx, input }: RequestReschedule
|
||||||
director.setBuilder(builder);
|
director.setBuilder(builder);
|
||||||
director.setExistingBooking(bookingToReschedule);
|
director.setExistingBooking(bookingToReschedule);
|
||||||
cancellationReason && director.setCancellationReason(cancellationReason);
|
cancellationReason && director.setCancellationReason(cancellationReason);
|
||||||
if (event) {
|
if (Object.keys(event).length) {
|
||||||
await director.buildForRescheduleEmail();
|
await director.buildForRescheduleEmail();
|
||||||
} else {
|
} else {
|
||||||
await director.buildWithoutEventTypeForRescheduleEmail();
|
await director.buildWithoutEventTypeForRescheduleEmail();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user