fix: Reschedule a cancelled booking
This commit is contained in:
parent
a2e70f9aad
commit
db49311bc9
|
@ -1307,6 +1307,7 @@
|
|||
"do_this": "Do this",
|
||||
"turn_off": "Turn off",
|
||||
"turn_on": "Turn on",
|
||||
"cancelled_bookings_cannot_be_rescheduled":"Cancelled bookings cannot be rescheduled",
|
||||
"settings_updated_successfully": "Settings updated successfully",
|
||||
"error_updating_settings": "Error updating settings",
|
||||
"personal_cal_url": "My personal {{appName}} URL",
|
||||
|
|
|
@ -1078,6 +1078,13 @@ async function handler(
|
|||
if (!originalRescheduledBooking) {
|
||||
throw new HttpError({ statusCode: 404, message: "Could not find original booking" });
|
||||
}
|
||||
|
||||
if (
|
||||
originalRescheduledBooking.status === BookingStatus.CANCELLED &&
|
||||
!originalRescheduledBooking.rescheduled
|
||||
) {
|
||||
throw new HttpError({ statusCode: 403, message: ErrorCode.CancelledBookingsCannotBeRescheduled });
|
||||
}
|
||||
}
|
||||
|
||||
//checks what users are available
|
||||
|
|
|
@ -6,4 +6,5 @@ export enum ErrorCode {
|
|||
AlreadySignedUpForBooking = "already_signed_up_for_this_booking_error",
|
||||
HostsUnavailableForBooking = "hosts_unavailable_for_booking",
|
||||
EventTypeNotFound = "event_type_not_found_error",
|
||||
CancelledBookingsCannotBeRescheduled = "cancelled_bookings_cannot_be_rescheduled",
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user