Add Personal Tree menu grouping

master
garrettmills 4 years ago
parent 4a3ebc1ba6
commit b82d7a51f2

@ -11,9 +11,21 @@ class Menu extends Controller {
}
async get_items(req, res) {
// Build the "My Tree" option
const root_page = await req.user.get_root_page()
const nodes = await this._build_menu_object(root_page)
return res.api(nodes)
const menu = []
menu.push({
id: 0,
name: 'My Info Tree',
children: nodes,
noDelete: true,
virtual: true,
expanded: true,
})
return res.api(menu)
}
async _build_menu_object(parent_node, arr= []) {

Loading…
Cancel
Save