Skip to content

Commit

Permalink
fix undefined object
Browse files Browse the repository at this point in the history
  • Loading branch information
jerem1508 committed Feb 16, 2024
1 parent 6d5246e commit 753e91f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/src/routes/tableaux/atlas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ router.route('/atlas/get-geo-polygons')
db.collection('citiesPolygons').find({ "com_code": geoId }).toArray().then((data) => {
// Format object
const obj = {};
obj["_id"] = data[0]._id;
obj.originalId = data[0].com_code;
obj.geometry = data[0].geom.geometry;
obj.nameFr = data[0].com_nom;
obj.parentOriginalId = data[0].uucr_id;
obj.originalId = data[0]?.com_code;
obj.geometry = data[0]?.geom?.geometry;
obj.nameFr = data[0]?.com_nom;
obj.parentOriginalId = data[0]?.uucr_id;

res.json([obj]);
})
Expand Down

0 comments on commit 753e91f

Please sign in to comment.