feat(SW-187): refactor footer query
This commit is contained in:
@@ -291,14 +291,12 @@ const validateInternalLink = z
|
||||
})
|
||||
.optional()
|
||||
|
||||
const validateLinkItem = z.object({
|
||||
export const validateLinkItem = z.object({
|
||||
open_in_new_tab: z.boolean(),
|
||||
link: validateExternalLink,
|
||||
pageConnection: validateInternalLink,
|
||||
})
|
||||
|
||||
export type FooterLinkItem = z.infer<typeof validateLinkItem>
|
||||
|
||||
export const validateFooterConfigSchema = z.object({
|
||||
all_footer: z.object({
|
||||
items: z.array(
|
||||
@@ -333,9 +331,6 @@ export const validateFooterConfigSchema = z.object({
|
||||
}),
|
||||
})
|
||||
|
||||
export type FooterDataRaw = z.infer<typeof validateFooterConfigSchema>
|
||||
export type FooterData = FooterDataRaw["all_footer"]["items"][0]
|
||||
|
||||
const pageConnectionRefs = z.object({
|
||||
edges: z.array(
|
||||
z.object({
|
||||
@@ -350,7 +345,7 @@ const pageConnectionRefs = z.object({
|
||||
),
|
||||
})
|
||||
|
||||
const validateFooterRefConfigSchema = z.object({
|
||||
export const validateFooterRefConfigSchema = z.object({
|
||||
all_footer: z.object({
|
||||
items: z.array(
|
||||
z.object({
|
||||
@@ -382,8 +377,6 @@ const validateFooterRefConfigSchema = z.object({
|
||||
}),
|
||||
})
|
||||
|
||||
export type FooterRefDataRaw = z.infer<typeof validateFooterRefConfigSchema>
|
||||
|
||||
const linkConnectionNodeSchema = z
|
||||
.object({
|
||||
edges: z
|
||||
|
||||
Reference in New Issue
Block a user