feat(SW-187): Added tertiary links data
This commit is contained in:
@@ -327,6 +327,7 @@ export const validateFooterConfigSchema = z.object({
|
||||
})
|
||||
),
|
||||
}),
|
||||
tertiary_links: z.array(validateLinkItem),
|
||||
})
|
||||
),
|
||||
}),
|
||||
@@ -367,6 +368,11 @@ const validateFooterRefConfigSchema = z.object({
|
||||
),
|
||||
})
|
||||
),
|
||||
tertiary_links: z.array(
|
||||
z.object({
|
||||
pageConnection: pageConnectionRefs,
|
||||
})
|
||||
),
|
||||
system: z.object({
|
||||
content_type_uid: z.string(),
|
||||
uid: z.string(),
|
||||
|
||||
@@ -510,7 +510,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(
|
||||
@@ -590,9 +590,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 {
|
||||
@@ -600,6 +601,7 @@ export const baseQueryRouter = router({
|
||||
appDownloads: validatedFooterData.app_downloads,
|
||||
secondaryLinks: secondaryLinks,
|
||||
socialMedia: validatedFooterData.social_media,
|
||||
tertiaryLinks: tertiaryLinks,
|
||||
}
|
||||
}),
|
||||
})
|
||||
|
||||
@@ -41,7 +41,6 @@ export function getConnections(refs: HeaderRefResponse) {
|
||||
}
|
||||
|
||||
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