Merged in fix/SW-2890-select-rate-not-updating (pull request #2190)
fix: select-rate didn't update results when switching back to a recent search SW-2890 * fix: select-rate didn't update results when switching back to a recent search Approved-by: Linus Flood
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { useSearchParams } from "next/navigation"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
@@ -7,6 +8,7 @@ import { trpc } from "@/lib/trpc/client"
|
||||
import Alert from "@/components/TempDesignSystem/Alert"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import RatesProvider from "@/providers/RatesProvider"
|
||||
import { convertSearchParamsToObj, searchParamsToRecord } from "@/utils/url"
|
||||
|
||||
import RateSummary from "./RateSummary"
|
||||
import Rooms from "./Rooms"
|
||||
@@ -15,16 +17,21 @@ import { RoomsContainerSkeleton } from "./RoomsContainerSkeleton"
|
||||
import styles from "./index.module.css"
|
||||
|
||||
import type { RoomsContainerProps } from "@/types/components/hotelReservation/selectRate/roomsContainer"
|
||||
import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import { AlertTypeEnum } from "@/types/enums/alert"
|
||||
|
||||
export function RoomsContainer({
|
||||
booking,
|
||||
hotelType,
|
||||
roomCategories,
|
||||
vat,
|
||||
}: RoomsContainerProps) {
|
||||
const lang = useLang()
|
||||
const intl = useIntl()
|
||||
const searchParams = useSearchParams()
|
||||
|
||||
const booking = convertSearchParamsToObj<SelectRateSearchParams>(
|
||||
searchParamsToRecord(searchParams)
|
||||
)
|
||||
|
||||
const { data, isFetching, isError, error } =
|
||||
trpc.hotel.availability.selectRate.rooms.useQuery(
|
||||
|
||||
Reference in New Issue
Block a user