refactor: url management in hotel reservation flow

This commit is contained in:
Christel Westerberg
2025-01-13 14:26:38 +01:00
parent 23ff0970e9
commit b2935114e3
48 changed files with 407 additions and 418 deletions

View File

@@ -20,8 +20,13 @@ export default async function SelectHotelMapPage({
setLang(params.lang)
const searchDetails = await getHotelSearchDetails({ searchParams })
if (!searchDetails) return notFound()
const { city, adultsInRoom, childrenInRoom, childrenInRoomArray } =
searchDetails
const {
city,
adultsInRoom,
childrenInRoom,
childrenInRoomArray,
selectHotelParams,
} = searchDetails
if (!city) return notFound()
@@ -34,7 +39,7 @@ export default async function SelectHotelMapPage({
>
<SelectHotelMapContainer
city={city}
searchParams={searchParams}
selectHotelParams={selectHotelParams}
adultsInRoom={adultsInRoom}
childrenInRoom={childrenInRoom}
child={childrenInRoomArray}

View File

@@ -3,7 +3,6 @@ import { Suspense } from "react"
import SelectHotel from "@/components/HotelReservation/SelectHotel"
import { SelectHotelSkeleton } from "@/components/HotelReservation/SelectHotel/SelectHotelSkeleton"
import { getHotelReservationQueryParams } from "@/components/HotelReservation/SelectRate/RoomSelection/utils"
import { setLang } from "@/i18n/serverContext"
import { getHotelSearchDetails } from "../utils"
@@ -20,7 +19,7 @@ export default async function SelectHotelPage({
if (!searchDetails) return notFound()
const {
city,
urlSearchParams,
selectHotelParams,
adultsInRoom,
childrenInRoom,
childrenInRoomArray,
@@ -29,8 +28,7 @@ export default async function SelectHotelPage({
if (!city) return notFound()
const reservationParams = {
selectHotelParams: urlSearchParams,
searchParams,
selectHotelParams,
adultsInRoom,
childrenInRoom,
childrenInRoomArray,