diff --git a/app/graphql/types/address_type.rb b/app/graphql/types/address_type.rb index 18f26f878..c72abc2ce 100644 --- a/app/graphql/types/address_type.rb +++ b/app/graphql/types/address_type.rb @@ -27,11 +27,11 @@ module Types field :geometry, Types::GeoJSON, "coordonnées géographique", null: true def city_name - if object['department_code'].present? && object['city_code'].present? - APIGeoService.commune_name(object.fetch('department_code'), object.fetch('city_code')) - else + APIGeoService.safely_normalize_city_name( + object['department_code'], + object['city_code'], object['city_name'] - end + ) end def department_name