feat(SW-187): Added tertiary links data
This commit is contained in:
@@ -317,6 +317,7 @@ export const validateFooterConfigSchema = z.object({
|
||||
})
|
||||
),
|
||||
}),
|
||||
tertiary_links: z.array(validateLinkItem),
|
||||
})
|
||||
),
|
||||
}),
|
||||
@@ -357,6 +358,11 @@ const validateFooterRefConfigSchema = z.object({
|
||||
),
|
||||
})
|
||||
),
|
||||
tertiary_links: z.array(
|
||||
z.object({
|
||||
pageConnection: pageConnectionRefs,
|
||||
})
|
||||
),
|
||||
system: z.object({
|
||||
content_type_uid: z.string(),
|
||||
uid: z.string(),
|
||||
|
||||
@@ -351,7 +351,7 @@ export const baseQueryRouter = router({
|
||||
},
|
||||
}
|
||||
)
|
||||
console.log("responseRef", responseRef)
|
||||
|
||||
// There's currently no error handling/validation for the responseRef, should it be added?
|
||||
getFooterCounter.add(1, { lang: input.lang })
|
||||
console.info(
|
||||
@@ -431,9 +431,10 @@ export const baseQueryRouter = router({
|
||||
})
|
||||
)
|
||||
|
||||
console.log(
|
||||
"secondaryLinks data",
|
||||
JSON.stringify(secondaryLinks, null, 4)
|
||||
console.log("secondaryLinks", JSON.stringify(secondaryLinks))
|
||||
|
||||
const tertiaryLinks = transformPageConnectionLinks(
|
||||
validatedFooterData.tertiary_links
|
||||
)
|
||||
|
||||
return {
|
||||
@@ -441,6 +442,7 @@ export const baseQueryRouter = router({
|
||||
appDownloads: validatedFooterData.app_downloads,
|
||||
secondaryLinks: secondaryLinks,
|
||||
socialMedia: validatedFooterData.social_media,
|
||||
tertiaryLinks: tertiaryLinks,
|
||||
}
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { FooterLinkItem } from "./output"
|
||||
|
||||
export function transformPageConnectionLinks(links: FooterLinkItem[]) {
|
||||
console.log("linksdata", links[0].pageConnection?.edges)
|
||||
if (!links) return []
|
||||
return links.flatMap((link) => {
|
||||
if (link.pageConnection?.edges.length) {
|
||||
|
||||
Reference in New Issue
Block a user