feat(SW-671): Added correct icons to amenities list
This commit is contained in:
@@ -6,6 +6,7 @@ import { imageMetaDataSchema, imageSizesSchema } from "./schemas/image"
|
||||
import { roomSchema } from "./schemas/room"
|
||||
import { getPoiGroupByCategoryName } from "./utils"
|
||||
|
||||
import { FacilityEnum } from "@/types/enums/facilities"
|
||||
import { PointOfInterestCategoryNameEnum } from "@/types/hotel"
|
||||
|
||||
const ratingsSchema = z
|
||||
@@ -142,7 +143,7 @@ const hotelContentSchema = z.object({
|
||||
})
|
||||
|
||||
const detailedFacilitySchema = z.object({
|
||||
id: z.number(),
|
||||
id: z.nativeEnum(FacilityEnum),
|
||||
name: z.string(),
|
||||
public: z.boolean(),
|
||||
sortOrder: z.number(),
|
||||
@@ -402,7 +403,11 @@ export const getHotelDataSchema = z.object({
|
||||
}),
|
||||
location: locationSchema,
|
||||
hotelContent: hotelContentSchema,
|
||||
detailedFacilities: z.array(detailedFacilitySchema),
|
||||
detailedFacilities: z
|
||||
.array(detailedFacilitySchema)
|
||||
.transform((facilities) =>
|
||||
facilities.sort((a, b) => b.sortOrder - a.sortOrder)
|
||||
),
|
||||
healthFacilities: z.array(healthFacilitySchema),
|
||||
merchantInformationData: merchantInformationSchema,
|
||||
rewardNight: rewardNightSchema,
|
||||
|
||||
@@ -46,7 +46,7 @@ import {
|
||||
TWENTYFOUR_HOURS,
|
||||
} from "./utils"
|
||||
|
||||
import { FacilityEnum } from "@/types/components/hotelPage/facilities"
|
||||
import { FacilityCardTypeEnum } from "@/types/components/hotelPage/facilities"
|
||||
import { AvailabilityEnum } from "@/types/components/hotelReservation/selectHotel/selectHotel"
|
||||
import type { RequestOptionsWithOutBody } from "@/types/fetch"
|
||||
import type { Facility } from "@/types/hotel"
|
||||
@@ -231,15 +231,15 @@ export const hotelQueryRouter = router({
|
||||
const facilities: Facility[] = [
|
||||
{
|
||||
...apiJson.data.attributes.restaurantImages,
|
||||
id: FacilityEnum.restaurant,
|
||||
id: FacilityCardTypeEnum.restaurant,
|
||||
},
|
||||
{
|
||||
...apiJson.data.attributes.conferencesAndMeetings,
|
||||
id: FacilityEnum.conference,
|
||||
id: FacilityCardTypeEnum.conference,
|
||||
},
|
||||
{
|
||||
...apiJson.data.attributes.healthAndWellness,
|
||||
id: FacilityEnum.wellness,
|
||||
id: FacilityCardTypeEnum.wellness,
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user