feat(SW-201): Added structured data for hotel pages
This commit is contained in:
@@ -153,26 +153,10 @@ export const metadataQueryRouter = router({
|
||||
)
|
||||
: null
|
||||
|
||||
const rawHotelData = hotelPageData
|
||||
|
||||
if (hotelData?.data.attributes) {
|
||||
const attributes = hotelData.data.attributes
|
||||
const images = attributes.gallery?.smallerImages
|
||||
|
||||
rawHotelData.hotelData = {
|
||||
name: attributes.name,
|
||||
city: attributes.cityName,
|
||||
description: attributes.hotelContent.texts.descriptions.short,
|
||||
image: images?.length
|
||||
? {
|
||||
url: images[0].imageSizes.small,
|
||||
alt: images[0].metaData.altText,
|
||||
}
|
||||
: null,
|
||||
}
|
||||
}
|
||||
|
||||
return getTransformedMetadata(rawHotelData)
|
||||
return getTransformedMetadata({
|
||||
...hotelPageData,
|
||||
hotelData: hotelData?.data.attributes,
|
||||
})
|
||||
default:
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user