|
|
|
@ -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= []) {
|
|
|
|
|