fix: unable to cancel a seated event as an host (#24426)
This commit is contained in:
1 parent
18c546a171
commit
5fd55cbfc3
1 file changed
+4
-2
@@ -64,13 +64,14 @@ export function getPendingActions(context: BookingActionContext): ActionType[] {
|
|||||||
|
|
||||||
export function getCancelEventAction(context: BookingActionContext): ActionType {
|
export function getCancelEventAction(context: BookingActionContext): ActionType {
|
||||||
const { booking, isTabRecurring, isRecurring, getSeatReferenceUid, t } = context;
|
const { booking, isTabRecurring, isRecurring, getSeatReferenceUid, t } = context;
|
||||||
|
const seatReferenceUid = getSeatReferenceUid();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: "cancel",
|
id: "cancel",
|
||||||
label: isTabRecurring && isRecurring ? t("cancel_all_remaining") : t("cancel_event"),
|
label: isTabRecurring && isRecurring ? t("cancel_all_remaining") : t("cancel_event"),
|
||||||
href: `/booking/${booking.uid}?cancel=true${
|
href: `/booking/${booking.uid}?cancel=true${
|
||||||
isTabRecurring && isRecurring ? "&allRemainingBookings=true" : ""
|
isTabRecurring && isRecurring ? "&allRemainingBookings=true" : ""
|
||||||
}${booking.seatsReferences.length ? `&seatReferenceUid=${getSeatReferenceUid()}` : ""}`,
|
}${booking.seatsReferences.length && seatReferenceUid ? `&seatReferenceUid=${seatReferenceUid}` : ""}`,
|
||||||
icon: "circle-x",
|
icon: "circle-x",
|
||||||
color: "destructive",
|
color: "destructive",
|
||||||
disabled: isActionDisabled("cancel", context),
|
disabled: isActionDisabled("cancel", context),
|
||||||
@@ -106,6 +107,7 @@ export function getEditEventActions(context: BookingActionContext): ActionType[]
|
|||||||
isAttendee,
|
isAttendee,
|
||||||
t,
|
t,
|
||||||
} = context;
|
} = context;
|
||||||
|
const seatReferenceUid = getSeatReferenceUid();
|
||||||
|
|
||||||
const actions: (ActionType | null)[] = [
|
const actions: (ActionType | null)[] = [
|
||||||
{
|
{
|
||||||
@@ -113,7 +115,7 @@ export function getEditEventActions(context: BookingActionContext): ActionType[]
|
|||||||
icon: "clock",
|
icon: "clock",
|
||||||
label: t("reschedule_booking"),
|
label: t("reschedule_booking"),
|
||||||
href: `/reschedule/${booking.uid}${
|
href: `/reschedule/${booking.uid}${
|
||||||
booking.seatsReferences.length && isAttendee ? `?seatReferenceUid=${getSeatReferenceUid()}` : ""
|
booking.seatsReferences.length && isAttendee && seatReferenceUid ? `?seatReferenceUid=${seatReferenceUid}` : ""
|
||||||
}`,
|
}`,
|
||||||
disabled:
|
disabled:
|
||||||
(isBookingInPast && !booking.eventType.allowReschedulingPastBookings) || isDisabledRescheduling,
|
(isBookingInPast && !booking.eventType.allowReschedulingPastBookings) || isDisabledRescheduling,
|
||||||
|
|||||||
Reference in new issue
Block a user