feat(SW-251): pr changes
This commit is contained in:
@@ -14,26 +14,11 @@ import { AvailabilityInput } from "@/types/components/hotelReservation/selectHot
|
|||||||
import { HotelData } from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps"
|
import { HotelData } from "@/types/components/hotelReservation/selectHotel/hotelCardListingProps"
|
||||||
import { LangParams, PageArgs } from "@/types/params"
|
import { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
async function getAvailableHotels({
|
async function getAvailableHotels(
|
||||||
cityId,
|
input: AvailabilityInput
|
||||||
roomStayStartDate,
|
): Promise<HotelData[]> {
|
||||||
roomStayEndDate,
|
console.log("This is the input: ", input)
|
||||||
adults,
|
const getAvailableHotels = await serverClient().hotel.availability.get(input)
|
||||||
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,
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!getAvailableHotels) throw new Error()
|
if (!getAvailableHotels) throw new Error()
|
||||||
|
|
||||||
@@ -73,7 +58,7 @@ export default async function SelectHotelPage({
|
|||||||
|
|
||||||
const filters = hotels.flatMap((data) => data.hotelData.detailedFacilities)
|
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: {
|
const filterList: {
|
||||||
name: string
|
name: string
|
||||||
id: number
|
id: number
|
||||||
@@ -83,8 +68,8 @@ export default async function SelectHotelPage({
|
|||||||
sortOrder: number
|
sortOrder: number
|
||||||
code?: string
|
code?: string
|
||||||
iconName?: string
|
iconName?: string
|
||||||
}[] = filterId
|
}[] = filterIds
|
||||||
.map((data) => filters.find((find) => find.id === data))
|
.map((id) => filters.find((find) => find.id === id))
|
||||||
.filter(
|
.filter(
|
||||||
(
|
(
|
||||||
filter
|
filter
|
||||||
|
|||||||
Reference in New Issue
Block a user