feat: navigation save / load
This commit is contained in:
1 parent
b870a4724d
commit
b26f30ae20
4 files changed
+54
-17
No files matched your search
@@ -16,12 +16,18 @@ module.exports = class Navigation extends Model {
|
||||
|
||||
properties: {
|
||||
key: {type: 'string'},
|
||||
config: {type: 'object'}
|
||||
config: {type: 'array', items: {type: 'object'}}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static async getTree() {
|
||||
return WIKI.models.navigation.query()
|
||||
const navTree = await WIKI.models.navigation.query().findOne('key', 'site')
|
||||
if (navTree) {
|
||||
return navTree.config
|
||||
} else {
|
||||
WIKI.logger.warn('Site Navigation is missing or corrupted.')
|
||||
return []
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user