feat: Add TRPC procedure for hotel API, schemas, and use in hotel content page
This commit is contained in:
@@ -7,13 +7,20 @@ import styles from "./hotelPage.module.css"
|
||||
import type { LangParams } from "@/types/params"
|
||||
|
||||
export default async function HotelPage({ lang }: LangParams) {
|
||||
const hotelPage = await serverClient().contentstack.hotelPage.get()
|
||||
if (!hotelPage) {
|
||||
const hotelPageIdentifierData =
|
||||
await serverClient().contentstack.hotelPage.get()
|
||||
|
||||
if (!hotelPageIdentifierData) {
|
||||
return null
|
||||
}
|
||||
|
||||
const hotelPageData = await serverClient().hotel.getHotel({
|
||||
hotelId: hotelPageIdentifierData.hotel_page_id,
|
||||
language: lang,
|
||||
})
|
||||
return (
|
||||
<section className={styles.content}>
|
||||
<Title>{hotelPage.title}</Title>
|
||||
<Title>{hotelPageData.data.attributes.name}</Title>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user