graphql(personne_morale): return full address
This commit is contained in:
parent
ca6b413e23
commit
da2312152d
1 changed files with 4 additions and 10 deletions
|
@ -124,16 +124,10 @@ module Types
|
||||||
field :complement_adresse, String, null: true, deprecation_reason: "Utilisez le champ `address` à la place."
|
field :complement_adresse, String, null: true, deprecation_reason: "Utilisez le champ `address` à la place."
|
||||||
|
|
||||||
def address
|
def address
|
||||||
{
|
APIGeoService
|
||||||
label: object.adresse,
|
.parse_etablissement_address(object)
|
||||||
type: "housenumber",
|
.merge(label: object.adresse, type: "housenumber")
|
||||||
street_number: object.numero_voie,
|
.with_indifferent_access
|
||||||
street_name: object.nom_voie,
|
|
||||||
street_address: object.nom_voie.present? ? [object.numero_voie, object.type_voie, object.nom_voie].compact.join(' ') : nil,
|
|
||||||
postal_code: object.code_postal.presence || '',
|
|
||||||
city_name: object.localite.presence || '',
|
|
||||||
city_code: object.code_insee_localite.presence || ''
|
|
||||||
}.with_indifferent_access
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def entreprise
|
def entreprise
|
||||||
|
|
Loading…
Reference in a new issue