2024-04-15 15:06:05 +02:00
|
|
|
class Champs::SiretController < Champs::ChampController
|
2018-09-06 19:23:27 +02:00
|
|
|
def show
|
2024-04-15 15:06:05 +02:00
|
|
|
champs_attributes = params.dig(:dossier, :champs_public_attributes) || params.dig(:dossier, :champs_private_attributes)
|
|
|
|
siret = champs_attributes.values.first[:value]
|
2023-01-14 10:13:26 +01:00
|
|
|
|
2024-04-15 15:06:05 +02:00
|
|
|
if @champ.fetch_etablissement!(siret, current_user)
|
2023-01-14 10:13:26 +01:00
|
|
|
@siret = @champ.etablissement.siret
|
|
|
|
else
|
|
|
|
@siret = @champ.etablissement_fetch_error_key
|
|
|
|
end
|
2019-05-02 11:24:22 +02:00
|
|
|
end
|
2018-04-03 17:53:14 +02:00
|
|
|
end
|