Zone.getLeaves() refactor
gitea/salix/master This commit looks good
Details
gitea/salix/master This commit looks good
Details
This commit is contained in:
parent
05fec10cf2
commit
40c555702d
|
@ -4,9 +4,10 @@ module.exports = Self => {
|
|||
description: 'Returns the nodes for a zone',
|
||||
accepts: [
|
||||
{
|
||||
arg: 'zoneFk',
|
||||
arg: 'id',
|
||||
type: 'Number',
|
||||
required: true,
|
||||
http: {source: 'path'},
|
||||
required: true
|
||||
}, {
|
||||
arg: 'parentFk',
|
||||
type: 'Number',
|
||||
|
@ -22,15 +23,15 @@ module.exports = Self => {
|
|||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/getLeaves`,
|
||||
path: `/:id/getLeaves`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.getLeaves = async(zoneFk, parentFk = null, search) => {
|
||||
Self.getLeaves = async(id, parentFk = null, search) => {
|
||||
let [res] = await Self.rawSql(
|
||||
`CALL zone_getLeaves(?, ?, ?)`,
|
||||
[zoneFk, parentFk, search]
|
||||
[id, parentFk, search]
|
||||
);
|
||||
|
||||
let map = new Map();
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
<vn-crud-model
|
||||
vn-id="model"
|
||||
url="/agency/api/Zones/getLeaves"
|
||||
url="/api/Zones/{{$ctrl.$stateParams.id}}/getLeaves"
|
||||
filter="::$ctrl.filter"
|
||||
params="{zoneFk: $ctrl.$stateParams.id}"
|
||||
auto-load="false">
|
||||
</vn-crud-model>
|
||||
<div class="main-with-right-menu">
|
||||
|
|
|
@ -2,11 +2,9 @@ import ngModule from '../module';
|
|||
|
||||
class Controller {
|
||||
constructor($, $http, $stateParams) {
|
||||
this.$stateParams = $stateParams;
|
||||
this.$ = $;
|
||||
this.$http = $http;
|
||||
this.searchValue = '';
|
||||
this.filter = {};
|
||||
this.$stateParams = $stateParams;
|
||||
}
|
||||
|
||||
onSearch(params) {
|
||||
|
|
Loading…
Reference in New Issue