From 19f666fee392960198a9b0f00ca911748e4fc9d9 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Fri, 13 Sep 2019 12:16:38 +0200 Subject: [PATCH] allowed null parent --- modules/agency/back/methods/zone-geo/getLeaves.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/agency/back/methods/zone-geo/getLeaves.js b/modules/agency/back/methods/zone-geo/getLeaves.js index 4f21aea41..54f04a796 100644 --- a/modules/agency/back/methods/zone-geo/getLeaves.js +++ b/modules/agency/back/methods/zone-geo/getLeaves.js @@ -31,7 +31,7 @@ module.exports = Self => { } }); - Self.getLeaves = async(zoneFk, parentFk = 1, filter) => { + Self.getLeaves = async(zoneFk, parentFk, filter) => { let conn = Self.dataSource.connector; let stmts = []; @@ -47,7 +47,7 @@ module.exports = Self => { isIncluded TINYINT ) ENGINE = MEMORY`)); - if (parentFk === 1) { + if (!parentFk) { stmts.push(new ParameterizedSQL( `INSERT INTO tmp.checkedChilds SELECT