feat(SW-159): merged contentstack and api requests for hotel query

This commit is contained in:
Erik Tiekstra
2024-08-12 16:36:17 +02:00
parent 93e54b4ca1
commit 7fd2fd7ec6
6 changed files with 80 additions and 32 deletions

View File

@@ -1,7 +1,5 @@
import { serverClient } from "@/lib/trpc/server"
import { getLang } from "@/i18n/serverContext"
import { MOCK_FACILITIES } from "./Facilities/mockData"
import AmenitiesList from "./AmenitiesList"
import Facilities from "./Facilities"
@@ -13,17 +11,7 @@ import TabNavigation from "./TabNavigation"
import styles from "./hotelPage.module.css"
export default async function HotelPage() {
const hotelPageIdentifierData =
await serverClient().contentstack.hotelPage.get()
if (!hotelPageIdentifierData) {
return null
}
const lang = getLang()
const hotelData = await serverClient().hotel.get({
hotelId: hotelPageIdentifierData.hotel_page_id,
language: lang,
include: ["RoomCategories"],
})
if (!hotelData) {