diff --git a/modules/agency/back/methods/zone-geo/getLeaves.js b/modules/agency/back/methods/zone/getLeaves.js similarity index 95% rename from modules/agency/back/methods/zone-geo/getLeaves.js rename to modules/agency/back/methods/zone/getLeaves.js index 11487304e..d919f97ac 100644 --- a/modules/agency/back/methods/zone-geo/getLeaves.js +++ b/modules/agency/back/methods/zone/getLeaves.js @@ -29,7 +29,7 @@ module.exports = Self => { Self.getLeaves = async(zoneFk, parentFk = null, search) => { let [res] = await Self.rawSql( - `CALL zoneGeo_getLeaves(?, ?, ?)`, + `CALL zone_getLeaves(?, ?, ?)`, [zoneFk, parentFk, search] ); @@ -51,6 +51,6 @@ module.exports = Self => { let leaves = map.get(parentFk); setLeaves(leaves); - return leaves; + return leaves || []; }; }; diff --git a/modules/agency/back/models/zone-geo.js b/modules/agency/back/models/zone-geo.js deleted file mode 100644 index 987e2de71..000000000 --- a/modules/agency/back/models/zone-geo.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Self => { - require('../methods/zone-geo/getLeaves')(Self); -}; diff --git a/modules/agency/back/models/zone.js b/modules/agency/back/models/zone.js index c7ba642f3..2c540603d 100644 --- a/modules/agency/back/models/zone.js +++ b/modules/agency/back/models/zone.js @@ -1,6 +1,7 @@ module.exports = Self => { require('../methods/zone/clone')(Self); require('../methods/zone/editPrices')(Self); + require('../methods/zone/getLeaves')(Self); Self.validatesPresenceOf('warehouseFk', { message: `Warehouse cannot be blank` diff --git a/modules/agency/front/location/index.html b/modules/agency/front/location/index.html index 8773530ea..53957faf7 100644 --- a/modules/agency/front/location/index.html +++ b/modules/agency/front/location/index.html @@ -1,6 +1,6 @@