fix: Added translated city name to meta title

Approved-by: Linus Flood
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-07-01 09:48:18 +00:00
parent 67ebef4fa0
commit ea4ef9a048
4 changed files with 17 additions and 9 deletions

View File

@@ -114,11 +114,15 @@ export const rawMetadataSchema = z.object({
hotelData: hotelAttributesSchema
.pick({
name: true,
address: true,
detailedFacilities: true,
hotelContent: true,
healthFacilities: true,
})
.merge(
z.object({
translatedCityName: z.string(),
})
)
.nullish(),
additionalHotelData: additionalDataAttributesSchema
.pick({

View File

@@ -184,7 +184,11 @@ export const metadataQueryRouter = router({
...hotelPageData,
...(hotelData
? {
hotelData: hotelData.hotel,
hotelData: {
...hotelData.hotel,
translatedCityName:
hotelData.cities?.[0]?.name || hotelData.hotel.cityName,
},
additionalHotelData: hotelData.additionalData,
hotelRestaurants: hotelData.restaurants,
}