fix: correct uid
This commit is contained in:
@@ -27,10 +27,15 @@ export default async function MyPagesLayout({
|
|||||||
|
|
||||||
function mapMenuItems(navigationItems: NavigationItem[]) {
|
function mapMenuItems(navigationItems: NavigationItem[]) {
|
||||||
return navigationItems.map(({ item }): MenuItem => {
|
return navigationItems.map(({ item }): MenuItem => {
|
||||||
const { title, uid } = item.pageConnection.edges[0].node
|
const {
|
||||||
|
title,
|
||||||
|
url,
|
||||||
|
system: { uid },
|
||||||
|
} = item.pageConnection.edges[0].node
|
||||||
return {
|
return {
|
||||||
title,
|
title,
|
||||||
uid,
|
uid,
|
||||||
|
url,
|
||||||
linkText: item.link_text,
|
linkText: item.link_text,
|
||||||
subItems: item.sub_items ? mapMenuItems(item.sub_items) : null,
|
subItems: item.sub_items ? mapMenuItems(item.sub_items) : null,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,15 @@ query GetNavigationMyPages {
|
|||||||
... on CodeDefinedPage {
|
... on CodeDefinedPage {
|
||||||
title
|
title
|
||||||
url
|
url
|
||||||
|
system {
|
||||||
|
uid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
... on ContentPage {
|
... on ContentPage {
|
||||||
title
|
title
|
||||||
|
system {
|
||||||
|
uid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,10 +38,16 @@ query GetNavigationMyPages {
|
|||||||
node {
|
node {
|
||||||
... on ContentPage {
|
... on ContentPage {
|
||||||
title
|
title
|
||||||
|
system {
|
||||||
|
uid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
... on CodeDefinedPage {
|
... on CodeDefinedPage {
|
||||||
title
|
title
|
||||||
url
|
url
|
||||||
|
system {
|
||||||
|
uid
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,12 @@ export type MenuItem = {
|
|||||||
|
|
||||||
export type SidebarProps = { menuItems: MenuItem[] }
|
export type SidebarProps = { menuItems: MenuItem[] }
|
||||||
|
|
||||||
export type PageLink = { uid: string; title: string; url?: string }
|
export type PageLink = {
|
||||||
|
uid: string
|
||||||
|
title: string
|
||||||
|
url?: string
|
||||||
|
system: { uid: string }
|
||||||
|
}
|
||||||
|
|
||||||
export type NavigationItem = {
|
export type NavigationItem = {
|
||||||
item: {
|
item: {
|
||||||
|
|||||||
Reference in New Issue
Block a user