feat(SW-187): Footer data from contentstack
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { HeaderRefResponse } from "@/types/header"
|
||||
import { Edges } from "@/types/requests/utils/edges"
|
||||
import { NodeRefs } from "@/types/requests/utils/refs"
|
||||
import type { FooterLinkItem } from "./output"
|
||||
|
||||
export function getConnections(refs: HeaderRefResponse) {
|
||||
const connections: Edges<NodeRefs>[] = []
|
||||
@@ -38,3 +39,12 @@ export function getConnections(refs: HeaderRefResponse) {
|
||||
|
||||
return connections
|
||||
}
|
||||
|
||||
export function transformPageConnectionLinks(links: FooterLinkItem[]) {
|
||||
return links.flatMap((link) =>
|
||||
link.pageConnection?.edges.map((edge) => ({
|
||||
title: edge.node.title,
|
||||
url: edge.node.url,
|
||||
}))
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user