Merge branch 'develop' into feature/tracking

This commit is contained in:
Linus Flood
2024-10-30 14:12:24 +01:00
261 changed files with 3397 additions and 2854 deletions

View File

@@ -7,6 +7,7 @@ import { getLocations } from "@/lib/trpc/memoizedRequests"
import {
fetchAvailableHotels,
generateChildrenString,
getFiltersFromHotels,
} from "@/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-hotel/utils"
import HotelCardListing from "@/components/HotelReservation/HotelCardListing"
@@ -50,7 +51,8 @@ export default async function SelectHotelPage({
const selectHotelParamsObject =
getHotelReservationQueryParams(selectHotelParams)
const adults = selectHotelParamsObject.room[0].adults // TODO: Handle multiple rooms
const children = selectHotelParamsObject.room[0].child?.length // TODO: Handle multiple rooms
const child = selectHotelParamsObject.room[0].child
const children = child ? generateChildrenString(child) : undefined // TODO: Handle multiple rooms
const hotels = await fetchAvailableHotels({
cityId: city.id,
@@ -80,7 +82,7 @@ export default async function SelectHotelPage({
arrivalDate: format(arrivalDate, "yyyy-MM-dd"),
departureDate: format(departureDate, "yyyy-MM-dd"),
noOfAdults: adults,
noOfChildren: children,
noOfChildren: child?.length,
noOfRooms: 1, // // TODO: Handle multiple rooms
duration: differenceInCalendarDays(departureDate, arrivalDate),
leadTime: differenceInCalendarDays(arrivalDate, new Date()),