feat: add included param to hotel call, fetch room data, setup schema, use in hotelpage
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { ImageProps } from "next/image"
|
||||
import { RoomData } from "@/types/hotel"
|
||||
|
||||
export interface RoomCardProps {
|
||||
id: string
|
||||
images: ImageProps[]
|
||||
images: RoomData["attributes"]["content"]["images"]
|
||||
title: string
|
||||
subtitle: string
|
||||
badgeTextTransKey?: string | null
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { ImageProps } from "next/image"
|
||||
|
||||
// TODO: Typings should be adjusted to match the actual data structure
|
||||
export interface RoomsProps {
|
||||
rooms: {
|
||||
id: string
|
||||
title: string
|
||||
subtitle: string
|
||||
popularChoice: boolean
|
||||
images: ImageProps[]
|
||||
}[]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { getHotelDataSchema } from "@/server/routers/hotels/output"
|
||||
import { getHotelDataSchema,RoomSchema } from "@/server/routers/hotels/output"
|
||||
|
||||
export type HotelData = z.infer<typeof getHotelDataSchema>
|
||||
|
||||
@@ -9,3 +9,5 @@ export type HotelAddress = HotelData["data"]["attributes"]["address"]
|
||||
export type HotelLocation = HotelData["data"]["attributes"]["location"]
|
||||
export type HotelTripAdvisor =
|
||||
HotelData["data"]["attributes"]["ratings"]["tripAdvisor"]
|
||||
|
||||
export type RoomData = z.infer<typeof RoomSchema>
|
||||
|
||||
Reference in New Issue
Block a user