Add API endpoint to fetch menu item tree
This commit is contained in:
@@ -6,12 +6,21 @@ const AuthUser = require('flitter-auth/model/User')
|
||||
* properties here as you need.
|
||||
*/
|
||||
class User extends AuthUser {
|
||||
static get services() {
|
||||
return [...super.services, 'models']
|
||||
}
|
||||
|
||||
static get schema() {
|
||||
return {...super.schema, ...{
|
||||
// other schema fields here
|
||||
}}
|
||||
}
|
||||
|
||||
async get_root_page() {
|
||||
const Page = this.models.get('api:Page')
|
||||
return Page.findOne({OrgUserId: this._id, ParentId: '0'})
|
||||
}
|
||||
|
||||
// Other members and methods here
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user