Merged in feat/SW-1333-hotel-endpoint (pull request #1206)

Feat(SW-133): Add additionalData endpoint

Approved-by: Erik Tiekstra
Approved-by: Fredrik Thorsson
This commit is contained in:
Matilda Landström
2025-01-27 11:39:13 +00:00
parent bf76c6277f
commit 577a4ca35e
17 changed files with 239 additions and 50 deletions

View File

@@ -41,7 +41,7 @@ import styles from "./hotelPage.module.css"
import { FacilityCardTypeEnum } from "@/types/components/hotelPage/facilities"
import type { HotelPageProps } from "@/types/components/hotelPage/hotelPage"
import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
import type { Facility } from "@/types/hotel"
import type { AdditionalData, Facility } from "@/types/hotel"
import { PageContentTypeEnum } from "@/types/requests/contentType"
export default async function HotelPage({ hotelId }: HotelPageProps) {
@@ -63,12 +63,7 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
name,
address,
pointsOfInterest,
gallery,
specialAlerts,
healthAndWellness,
restaurantImages,
conferencesAndMeetings,
hotelRoomElevatorPitchText,
hotelContent,
detailedFacilities,
healthFacilities,
@@ -79,8 +74,18 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
ratings,
parking,
} = hotelData.data.attributes
const roomCategories = hotelData.included?.rooms || []
const restaurants = hotelData.included?.restaurants || []
const roomCategories = hotelData.included.rooms || []
const restaurants = hotelData.included.restaurants || []
const additionalData =
hotelData.included.additionalData || ({} as AdditionalData)
const {
healthAndWellness,
restaurantImages,
conferencesAndMeetings,
hotelRoomElevatorPitchText,
gallery,
} = additionalData
const images = gallery?.smallerImages
const description = hotelContent.texts.descriptions.medium