From a319eed5f6240b003c5a37166dba35cad10c88db Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 19 Sep 2019 17:49:46 +0200 Subject: [PATCH] Zone.getLeaves() refactor --- modules/agency/back/methods/zone/getLeaves.js | 11 ++++++----- modules/agency/front/location/index.html | 3 +-- modules/agency/front/location/index.js | 4 +--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/modules/agency/back/methods/zone/getLeaves.js b/modules/agency/back/methods/zone/getLeaves.js index d919f97ac..50ee54345 100644 --- a/modules/agency/back/methods/zone/getLeaves.js +++ b/modules/agency/back/methods/zone/getLeaves.js @@ -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(); diff --git a/modules/agency/front/location/index.html b/modules/agency/front/location/index.html index 53957faf7..c45fd5cd6 100644 --- a/modules/agency/front/location/index.html +++ b/modules/agency/front/location/index.html @@ -1,8 +1,7 @@
diff --git a/modules/agency/front/location/index.js b/modules/agency/front/location/index.js index d09bb5891..3e3decf23 100644 --- a/modules/agency/front/location/index.js +++ b/modules/agency/front/location/index.js @@ -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) {