diff --git a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx index 4e5f85841..948cafbc2 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx @@ -14,26 +14,11 @@ import { AvailabilityInput } from "@/types/components/hotelReservation/selectHot import { HotelData } from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps" import { LangParams, PageArgs } from "@/types/params" -async function getAvailableHotels({ - cityId, - roomStayStartDate, - roomStayEndDate, - adults, - children, - promotionCode, - attachedProfileId, - reservationProfileType, -}: AvailabilityInput): Promise { - const getAvailableHotels = await serverClient().hotel.availability.get({ - cityId: cityId, - roomStayStartDate: roomStayStartDate, - roomStayEndDate: roomStayEndDate, - adults: adults, - children: children, - promotionCode: promotionCode, - attachedProfileId: attachedProfileId, - reservationProfileType: reservationProfileType, - }) +async function getAvailableHotels( + input: AvailabilityInput +): Promise { + console.log("This is the input: ", input) + const getAvailableHotels = await serverClient().hotel.availability.get(input) if (!getAvailableHotels) throw new Error() @@ -73,7 +58,7 @@ export default async function SelectHotelPage({ const filters = hotels.flatMap((data) => data.hotelData.detailedFacilities) - const filterId = [...new Set(filters.map((data) => data.id))] + const filterIds = [...new Set(filters.map((data) => data.id))] const filterList: { name: string id: number @@ -83,8 +68,8 @@ export default async function SelectHotelPage({ sortOrder: number code?: string iconName?: string - }[] = filterId - .map((data) => filters.find((find) => find.id === data)) + }[] = filterIds + .map((id) => filters.find((find) => find.id === id)) .filter( ( filter