fix(SW-188): improve semantics, use hotel instead of attribute naming

This commit is contained in:
Chuma McPhoy
2024-08-14 08:27:56 +02:00
parent ed379202c8
commit 3a2a58a9ca
7 changed files with 24 additions and 25 deletions

View File

@@ -27,8 +27,8 @@ export default async function SelectHotelPage({
return null
}
const { attributes } = hotelData
const hotels = [attributes]
const { hotel } = hotelData
const hotels = [hotel]
const hotelFilters = await serverClient().hotel.getFilters({
hotelId: "879",

View File

@@ -15,14 +15,13 @@ export default async function SelectRate({ params }: PageArgs<LangParams>) {
setLang(params.lang)
// TODO: pass the correct hotel ID
const hotel = await serverClient().hotel.getHotel({
const hotelData = await serverClient().hotel.getHotel({
hotelId: "879",
language: getLang(),
})
if (!hotel) return null
const { attributes } = hotel
if (!hotelData) return null
const { hotel } = hotelData
const rooms = await serverClient().hotel.getRates({
// TODO: pass the correct hotel ID and all other parameters that should be included in the search
@@ -33,7 +32,7 @@ export default async function SelectRate({ params }: PageArgs<LangParams>) {
<div className={styles.page}>
<main className={styles.content}>
<div className={styles.hotelInfo}>
<HotelCard hotel={attributes} />
<HotelCard hotel={hotel} />
</div>
<RoomSelection rooms={rooms} />
<FlexibilitySelection />