fix: refactor tracking requests

This commit is contained in:
Christel Westerberg
2024-07-15 13:35:00 +02:00
parent c7446032fe
commit 183e1cd6d2
14 changed files with 74 additions and 163 deletions

View File

@@ -193,7 +193,12 @@ export const validateLoyaltyPageSchema = z.object({
heading: z.string().nullable(),
blocks: z.array(loyaltyPageBlockItem).nullable(),
sidebar: z.array(loyaltyPageSidebarItem).nullable(),
system: z.object({ uid: z.string() }),
system: z.object({
uid: z.string(),
locale: z.nativeEnum(Lang),
created_at: z.string(),
updated_at: z.string(),
}),
})
// Block types
@@ -417,17 +422,3 @@ export const validateLoyaltyPageRefsSchema = z.object({
export type LoyaltyPageRefsDataRaw = z.infer<
typeof validateLoyaltyPageRefsSchema
>
//Tracking
const validateLoyaltyTrackingData = z.object({
loyalty_page: z.object({
system: z.object({
uid: z.string(),
locale: z.string(),
updated_at: z.string(),
created_at: z.string(),
}),
}),
})
export type LoyaltyPageTackingData = z.infer<typeof validateLoyaltyTrackingData>