fix Admin Menu

master
Boris Voropaev 2024-01-10 17:32:08 +03:00
parent 723f8ab4d6
commit c3fd6969d7
1 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,7 @@ export class PagesMenuComponent implements OnInit {
resp=>{
let [currentPage, rootPages] = resp
if(currentPage){
console.log('current')
let menuTree = currentPage.parents.data.reduceRight(
(menuTree,item)=>{
let fothersSonID = item.children.data.findIndex(
@ -38,7 +39,11 @@ export class PagesMenuComponent implements OnInit {
}, currentPage);
this.items = menuTree.children.data;
}else{
this.items = rootPages?.data[0].children.data
if(rootPages){
this.items = rootPages.data.find(
page => page.slug == this.pagesService.rootPage.slug
)?.children.data
}
}
}
)