feat(WEB-209): revalidate my pages navigation on demand
This commit is contained in:
committed by
Michael Zetterberg
parent
16634abbbf
commit
1bffbc837e
18
server/routers/contentstack/myPages/navigation/utils.ts
Normal file
18
server/routers/contentstack/myPages/navigation/utils.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { GetNavigationMyPagesRefsData } from "@/types/requests/myPages/navigation"
|
||||
import type { Edges } from "@/types/requests/utils/edges"
|
||||
import type { NodeRefs } from "@/types/requests/utils/refs"
|
||||
|
||||
export function getConnections(refs: GetNavigationMyPagesRefsData) {
|
||||
const connections: Edges<NodeRefs>[] = []
|
||||
refs.all_navigation_my_pages.items.forEach((ref) => {
|
||||
ref.items.forEach(({ item }) => {
|
||||
connections.push(item.pageConnection)
|
||||
|
||||
item.sub_items.forEach(({ item: subItem }) => {
|
||||
connections.push(subItem.pageConnection)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
return connections
|
||||
}
|
||||
Reference in New Issue
Block a user