feat: update getHotel to use real hotel api endpoint, support for service tokens, type modifications
This commit is contained in:
@@ -18,14 +18,20 @@ export default async function SelectHotelPage({
|
||||
const intl = await getIntl()
|
||||
setLang(params.lang)
|
||||
|
||||
const { attributes } = await serverClient().hotel.getHotel({
|
||||
hotelId: "d98c7ab1-ebaa-4102-b351-758daf1ddf55",
|
||||
const hotelData = await serverClient().hotel.getHotel({
|
||||
hotelId: "879",
|
||||
language: getLang(),
|
||||
})
|
||||
|
||||
if (!hotelData) {
|
||||
return null
|
||||
}
|
||||
|
||||
const { attributes } = hotelData
|
||||
const hotels = [attributes]
|
||||
|
||||
const hotelFilters = await serverClient().hotel.getFilters({
|
||||
hotelId: "d98c7ab1-ebaa-4102-b351-758daf1ddf55",
|
||||
hotelId: "879",
|
||||
})
|
||||
|
||||
const tempSearchTerm = "Stockholm"
|
||||
|
||||
@@ -15,10 +15,15 @@ export default async function SelectRate({ params }: PageArgs<LangParams>) {
|
||||
setLang(params.lang)
|
||||
|
||||
// TODO: pass the correct hotel ID
|
||||
const { attributes: hotel } = await serverClient().hotel.getHotel({
|
||||
hotelId: "d98c7ab1-ebaa-4102-b351-758daf1ddf55",
|
||||
const hotel = await serverClient().hotel.getHotel({
|
||||
hotelId: "879",
|
||||
language: getLang(),
|
||||
})
|
||||
|
||||
if (!hotel) return null
|
||||
|
||||
const { attributes } = hotel
|
||||
|
||||
const rooms = await serverClient().hotel.getRates({
|
||||
// TODO: pass the correct hotel ID and all other parameters that should be included in the search
|
||||
hotelId: "1",
|
||||
@@ -28,7 +33,7 @@ export default async function SelectRate({ params }: PageArgs<LangParams>) {
|
||||
<div className={styles.page}>
|
||||
<main className={styles.content}>
|
||||
<div className={styles.hotelInfo}>
|
||||
<HotelCard hotel={hotel} />
|
||||
<HotelCard hotel={attributes} />
|
||||
</div>
|
||||
<RoomSelection rooms={rooms} />
|
||||
<FlexibilitySelection />
|
||||
|
||||
Reference in New Issue
Block a user