feat: consume serach params in summary and step page
This commit is contained in:
@@ -29,17 +29,26 @@ export const getRoomsAvailabilityInputSchema = z.object({
|
||||
rateCode: z.string().optional(),
|
||||
})
|
||||
|
||||
export type GetRoomsAvailabilityInput = z.input<
|
||||
typeof getRoomsAvailabilityInputSchema
|
||||
>
|
||||
|
||||
export const getRatesInputSchema = z.object({
|
||||
hotelId: z.string(),
|
||||
})
|
||||
|
||||
export const getlHotelDataInputSchema = z.object({
|
||||
export enum HotelIncludeEnum {
|
||||
"RoomCategories",
|
||||
"NearbyHotels",
|
||||
"Restaurants",
|
||||
"City",
|
||||
}
|
||||
|
||||
export const getHotelDataInputSchema = z.object({
|
||||
hotelId: z.string(),
|
||||
language: z.string(),
|
||||
isCardOnlyPayment: z.boolean().optional(),
|
||||
include: z
|
||||
.array(z.enum(["RoomCategories", "NearbyHotels", "Restaurants", "City"]))
|
||||
.optional(),
|
||||
include: z.array(z.nativeEnum(HotelIncludeEnum)).optional(),
|
||||
})
|
||||
|
||||
export const getBreakfastPackageInput = z.object({
|
||||
|
||||
@@ -32,9 +32,9 @@ import {
|
||||
} from "./schemas/packages"
|
||||
import {
|
||||
getBreakfastPackageInput,
|
||||
getHotelDataInputSchema,
|
||||
getHotelInputSchema,
|
||||
getHotelsAvailabilityInputSchema,
|
||||
getlHotelDataInputSchema,
|
||||
getRatesInputSchema,
|
||||
getRoomsAvailabilityInputSchema,
|
||||
} from "./input"
|
||||
@@ -584,7 +584,7 @@ export const hotelQueryRouter = router({
|
||||
}),
|
||||
hotelData: router({
|
||||
get: serviceProcedure
|
||||
.input(getlHotelDataInputSchema)
|
||||
.input(getHotelDataInputSchema)
|
||||
.query(async ({ ctx, input }) => {
|
||||
const { hotelId, language, include, isCardOnlyPayment } = input
|
||||
|
||||
|
||||
@@ -87,8 +87,11 @@ export const roomSchema = z
|
||||
name: data.attributes.name,
|
||||
occupancy: data.attributes.occupancy,
|
||||
roomSize: data.attributes.roomSize,
|
||||
roomTypes: data.attributes.roomTypes,
|
||||
sortOrder: data.attributes.sortOrder,
|
||||
type: data.type,
|
||||
roomFacilities: data.attributes.roomFacilities,
|
||||
}
|
||||
})
|
||||
|
||||
export type RoomType = Pick<z.output<typeof roomSchema>, "roomTypes" | "name">
|
||||
|
||||
Reference in New Issue
Block a user