2019-10-01 12:19:10 +00:00
|
|
|
const common = require('./common')
|
|
|
|
|
|
|
|
const Tree = window.__nfptree || []
|
|
|
|
|
|
|
|
exports.Tree = Tree
|
|
|
|
|
|
|
|
exports.getTree = function() {
|
|
|
|
return common.sendRequest({
|
|
|
|
method: 'GET',
|
|
|
|
url: '/api/pages?tree=true&includes=children&fields=id,name,path,children(id,name,path)',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.getPage = function(id) {
|
|
|
|
return common.sendRequest({
|
|
|
|
method: 'GET',
|
2019-10-01 17:18:20 +00:00
|
|
|
url: '/api/pages/' + id + '?includes=media,banner,children',
|
2019-10-01 12:19:10 +00:00
|
|
|
})
|
|
|
|
}
|