Merge pull request #5992 from tchak/fix-more-address-null-fields

Return empty strings for incomplete api entreprise adresses
This commit is contained in:
Paul Chavard 2021-03-17 14:38:11 +01:00 committed by GitHub
commit de5c2d3032
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,9 +108,9 @@ module Types
street_number: object.numero_voie, street_number: object.numero_voie,
street_name: object.nom_voie, street_name: object.nom_voie,
street_address: object.nom_voie.present? ? [object.numero_voie, object.type_voie, object.nom_voie].compact.join(' ') : nil, street_address: object.nom_voie.present? ? [object.numero_voie, object.type_voie, object.nom_voie].compact.join(' ') : nil,
postal_code: object.code_postal, postal_code: object.code_postal.presence || '',
city_name: object.localite, city_name: object.localite.presence || '',
city_code: object.code_insee_localite city_code: object.code_insee_localite.presence || ''
} }
end end