Skip to content

Commit

Permalink
fix etat filter
Browse files Browse the repository at this point in the history
  • Loading branch information
folland87 committed Sep 26, 2024
1 parent 0854257 commit 77ad799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/opendata/opendata.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ router.route("/opendata/:datasetId").get(async (req, res) => {

router.route("/exports/annelis/gouvernance").get(async (req, res) => {
const annelis = req.query.annelis;
const etat = req.query.etat;
const etat = req.query.etat?.split(",");

const query = { dataset: "fr-esr-paysage-fonctions-gouvernance" };
if (annelis) query.annelis = annelis;
if (etat) query.etat = etat;
if (Array.isArray(etat)) query.etat = { $in: etat };
const data = await db.collection("opendata").find(query, OPTIONS).toArray();
res.status(200).json(data);
});
Expand Down

0 comments on commit 77ad799

Please sign in to comment.