feat(SW-3288): Added sort order on campaign pages to sort campaigns on hotel pages
Approved-by: Matilda Landström
This commit is contained in:
@@ -185,6 +185,7 @@ export const campaignPagesByHotelUidSchema = z
|
||||
z.object({
|
||||
heading: z.string(),
|
||||
url: z.string(),
|
||||
sort_order: z.number().nullish(),
|
||||
card_content: z
|
||||
.object({
|
||||
image: tempImageVaultAssetSchema,
|
||||
@@ -198,7 +199,8 @@ export const campaignPagesByHotelUidSchema = z
|
||||
)
|
||||
.transform((data) => {
|
||||
const mappedCampaigns = data.map((campaign) => {
|
||||
const { card_content, hero, system, heading, url } = campaign
|
||||
const { card_content, hero, system, heading, sort_order, url } =
|
||||
campaign
|
||||
const hasImage = !!(card_content?.image || hero.image)
|
||||
const cardContentImage = card_content?.image || hero.image
|
||||
const heroImage = hero.image || card_content?.image
|
||||
@@ -207,6 +209,7 @@ export const campaignPagesByHotelUidSchema = z
|
||||
return {
|
||||
id: system.uid,
|
||||
url: removeMultipleSlashes(`/${system.locale}/${url}`),
|
||||
sort_order,
|
||||
card_content: {
|
||||
...card_content,
|
||||
heading: card_content?.heading || heading,
|
||||
|
||||
Reference in New Issue
Block a user