Skip to content

Commit

Permalink
Fix filter on subunits (ghost + cmpl_type) (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
obieler authored Oct 25, 2023
1 parent 135e4cf commit 93e2538
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/unit.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 93e2538

Please sign in to comment.