feat(SW-3121): Added support for campaign text inside the hero of campaign pages

* fix: making sure the cacheKey for getHotelsByHotelIds is not sorting the original array

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-08-28 13:46:48 +00:00
parent 8a53e97e5f
commit 2e655619d1
5 changed files with 57 additions and 8 deletions

View File

@@ -68,7 +68,25 @@ export const heroSchema = z.object({
bold_text: z.string().nullish(),
text: z.string().nullish(),
})
.nullish(),
.nullish()
.transform((data) => {
if (data?.bold_text || data?.text) {
return data
}
return null
}),
campaign_text: z
.object({
text: z.string().nullish(),
bold_text: z.string().nullish(),
})
.nullish()
.transform((data) => {
if (data?.bold_text || data?.text) {
return data
}
return null
}),
button: z
.intersection(z.object({ cta: z.string() }), linkConnectionSchema)
.transform((data) => {