Skip to content

Commit

Permalink
Fix #65
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesboeufs committed Aug 4, 2016
1 parent 53b24ef commit 673c05e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ function formatOne(req, target) {
const properties = pick(target, Array.from(req.fields));

if (target.codeDepartement && req.fields.has('departement')) {
const departement = req.db.departements.queryByCode(target.codeDepartement)[0];
const departement = req.db.departements.search({ code: target.codeDepartement })[0];
properties.departement = pick(departement, 'code', 'nom');
}

if (target.codeRegion && req.fields.has('region')) {
const region = req.db.regions.queryByCode(target.codeRegion)[0];
const region = req.db.regions.search({ code: target.codeRegion })[0];
properties.region = pick(region, 'code', 'nom');
}

Expand Down

0 comments on commit 673c05e

Please sign in to comment.