From 934529a3c428541b367c031d2837652994a6a50b Mon Sep 17 00:00:00 2001 From: Olivier Bieler Date: Wed, 25 Oct 2023 14:29:33 +0200 Subject: [PATCH] Fix filter on subunits (ghost + cmpl_type) --- src/services/unit.service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/unit.service.js b/src/services/unit.service.js index e0259fe..ec68753 100644 --- a/src/services/unit.service.js +++ b/src/services/unit.service.js @@ -150,7 +150,8 @@ async function getUnitPath (hierarchy, lang) { async function getSubunits (unitId, lang) { const query = 'SELECT sigle, libelle, libelle_en ' + 'FROM Unites_v2 ' + - 'WHERE id_parent = ? AND cmpl_type <> ?'; + 'WHERE id_parent = ? AND ' + + '(ghost = 1 OR ISNULL(cmpl_type) OR cmpl_type <> ?)'; const values = [unitId, 'Z']; const results = await cadidbService.sendQuery(query, values, 'getSubunits');