feat(SW-251): pr changes

This commit is contained in:
Fredrik Thorsson
2024-09-13 09:19:35 +02:00
parent 7547da73d2
commit 4287b868fa

View File

@@ -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<HotelData[]> {
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<HotelData[]> {
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