Feat/SW-3028 hotel page campaigns
* feat(SW-3028): Added query and typings to fetch campaigns by hotelUid * feat(SW-3028): Added components for campaigns to the hotel page * feat(SW-3028): Implemented prioritized campaigns list * chore(SW-3028): Refactor how campaigns are fetched on hotel pages * feat(SW-3028): Added offers/campaigns to tab navigation Approved-by: Matilda Landström
This commit is contained in:
@@ -70,6 +70,34 @@ export const hotelPageSchema = z.object({
|
||||
hotel_page_id: z.string(),
|
||||
title: z.string(),
|
||||
url: z.string(),
|
||||
campaigns: z
|
||||
.object({
|
||||
heading: z.string(),
|
||||
preamble: z.string(),
|
||||
prioritized_campaignsConnection: z.object({
|
||||
edges: z.array(
|
||||
z.object({
|
||||
node: z.object({
|
||||
system: z.object({
|
||||
uid: z.string(),
|
||||
}),
|
||||
}),
|
||||
})
|
||||
),
|
||||
}),
|
||||
})
|
||||
.nullish()
|
||||
.transform((data) => {
|
||||
const prioritizedCampaigns =
|
||||
data?.prioritized_campaignsConnection.edges.map(
|
||||
(edge) => edge.node.system.uid
|
||||
) || []
|
||||
return {
|
||||
heading: data?.heading,
|
||||
preamble: data?.preamble,
|
||||
prioritizedCampaigns,
|
||||
}
|
||||
}),
|
||||
system: systemSchema.merge(
|
||||
z.object({
|
||||
created_at: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user