fix: make sure ancillaries also listen to invalidate requests
This commit is contained in:
committed by
Simon.Emanuelsson
parent
623495a176
commit
0b960200b9
@@ -11,10 +11,8 @@ import { toast } from "@/components/TempDesignSystem/Toasts"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { trackRemoveAncillary } from "@/utils/tracking/myStay"
|
||||
|
||||
import type {
|
||||
BookingConfirmation,
|
||||
PackageSchema,
|
||||
} from "@/types/trpc/routers/booking/confirmation"
|
||||
import type { Room } from "@/types/stores/my-stay"
|
||||
import type { PackageSchema } from "@/types/trpc/routers/booking/confirmation"
|
||||
|
||||
export default function RemoveButton({
|
||||
refId,
|
||||
@@ -26,7 +24,7 @@ export default function RemoveButton({
|
||||
refId: string
|
||||
codes: string[]
|
||||
title?: string
|
||||
booking: BookingConfirmation["booking"]
|
||||
booking: Room
|
||||
ancillary: PackageSchema
|
||||
}) {
|
||||
const lang = useLang()
|
||||
|
||||
@@ -16,10 +16,8 @@ import styles from "./addedAncillaries.module.css"
|
||||
|
||||
import type { AddedAncillariesProps } from "@/types/components/myPages/myStay/ancillaries"
|
||||
import { BreakfastPackageEnum } from "@/types/enums/breakfast"
|
||||
import type {
|
||||
BookingConfirmation,
|
||||
PackageSchema,
|
||||
} from "@/types/trpc/routers/booking/confirmation"
|
||||
import type { Room } from "@/types/stores/my-stay"
|
||||
import type { PackageSchema } from "@/types/trpc/routers/booking/confirmation"
|
||||
|
||||
export function AddedAncillaries({
|
||||
ancillaries,
|
||||
@@ -28,7 +26,7 @@ export function AddedAncillaries({
|
||||
const intl = useIntl()
|
||||
|
||||
const addedBreakfastPackages = getBreakfastPackagesFromAncillaryFlow(
|
||||
booking.packages
|
||||
booking.originalPackages
|
||||
)
|
||||
|
||||
const addedAncillaries = getAddedAncillaries(booking, addedBreakfastPackages)
|
||||
@@ -226,7 +224,7 @@ export function AddedAncillaries({
|
||||
* not in the booking flow.
|
||||
*/
|
||||
function getAddedAncillaries(
|
||||
booking: BookingConfirmation["booking"],
|
||||
booking: Room,
|
||||
addedBreakfastPackages: PackageSchema[] | undefined
|
||||
) {
|
||||
if (!addedBreakfastPackages?.length) {
|
||||
|
||||
Reference in New Issue
Block a user