Refactor
This commit is contained in:
@@ -178,9 +178,6 @@ export const loyaltyPageSchema = z.object({
|
||||
updated_at: z.string(),
|
||||
})
|
||||
),
|
||||
page_settings: z.object({
|
||||
tracking_page_name: z.string().nullable(),
|
||||
}),
|
||||
})
|
||||
.transform((data) => {
|
||||
return {
|
||||
@@ -190,7 +187,9 @@ export const loyaltyPageSchema = z.object({
|
||||
preamble: data.preamble,
|
||||
sidebar: data.sidebar ? data.sidebar : [],
|
||||
system: data.system,
|
||||
pageSettings: data.page_settings,
|
||||
}
|
||||
}),
|
||||
trackingProps: z.object({
|
||||
url: z.string(),
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -181,8 +181,7 @@ export const loyaltyPageQueryRouter = router({
|
||||
createdDate: loyaltyPage.system.created_at,
|
||||
channel: TrackingChannelEnum["scandic-friends"],
|
||||
pageType: "loyaltycontentpage",
|
||||
pageName: loyaltyPage.pageSettings.tracking_page_name,
|
||||
siteSections: loyaltyPage.pageSettings.tracking_page_name, // Always the same as pageName for this page
|
||||
pageName: validatedLoyaltyPage.data.trackingProps.url,
|
||||
}
|
||||
getLoyaltyPageSuccessCounter.add(1, metricsVariables)
|
||||
console.info(
|
||||
|
||||
Reference in New Issue
Block a user