Skip to content

Commit

Permalink
Merge branch 'develop' into sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
ericplaquevent committed Apr 22, 2021
2 parents e47bcda + 8308bf2 commit e430e22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions server/src/logic/controllers/geo/geoAdresseData.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class GeoAdresseData {
// cas particulier concernant un unique college à saint barth'
return {
geo_coordonnees: "17.896279,-62.849772", // format "lat,long"
results_count: 1,
};
}

Expand All @@ -36,6 +37,7 @@ class GeoAdresseData {
);
return {
geo_coordonnees: null,
results_count: 0,
};
}

Expand Down Expand Up @@ -66,6 +68,7 @@ class GeoAdresseData {
if (!responseApiAdresse)
return {
geo_coordonnees: null,
results_count: 0,
};

if (responseApiAdresse.features.length === 0) {
Expand All @@ -80,6 +83,7 @@ class GeoAdresseData {
);
return {
geo_coordonnees: null,
results_count: 0,
};
}

Expand All @@ -100,6 +104,7 @@ class GeoAdresseData {

return {
geo_coordonnees: `${geojson.features[0].geometry.coordinates[1]},${geojson.features[0].geometry.coordinates[0]}`, // format "lat,long"
results_count: geojson.features.length,
};
}

Expand Down
3 changes: 2 additions & 1 deletion server/src/logic/controllers/geo/geoController.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class GeoController {
}

async findGeoCoordinateFromAdresse({ numero_voie, type_voie, nom_voie, code_postal, localite }) {
const { geo_coordonnees } = await geoAdresseData.getGeoCoordinateFromAdresse({
const { geo_coordonnees, results_count } = await geoAdresseData.getGeoCoordinateFromAdresse({
numero_voie,
type_voie,
nom_voie,
Expand All @@ -149,6 +149,7 @@ class GeoController {
return {
info: `Ok`,
value: geo_coordonnees,
count: results_count,
};
}

Expand Down
1 change: 1 addition & 0 deletions server/src/logic/handlers/geoHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const getCoordinatesFromAddressData = async ({ numero_voie, type_voie, nom_voie,
return {
result: {
geo_coordonnees: coordUpdated.value,
results_count: coordUpdated.count,
},
messages: {
geo_coordonnees: coordUpdated.info,
Expand Down

0 comments on commit e430e22

Please sign in to comment.