Give procedure_id to SIRETService

This commit is contained in:
Paul Chavard 2018-03-29 17:56:47 +02:00
parent 1961c39f26
commit fd8674dffc
2 changed files with 2 additions and 4 deletions

View file

@ -105,7 +105,7 @@ class Users::DossiersController < UsersController
update_current_user_siret!(siret)
etablissement_attributes = SIRETService.fetch(siret, @facade.dossier)
etablissement_attributes = SIRETService.fetch(siret, @facade.dossier.procedure_id, @facade.dossier)
if etablissement_attributes.present?
etablissement_attributes = ActionController::Parameters.new(etablissement_attributes).permit!

View file

@ -1,7 +1,5 @@
class SIRETService
def self.fetch(siret, dossier = nil)
procedure_id = dossier&.procedure_id
def self.fetch(siret, procedure_id, dossier = nil)
etablissement_params = ApiEntreprise::EtablissementAdapter.new(siret, procedure_id).to_params
entreprise_params = ApiEntreprise::EntrepriseAdapter.new(siret, procedure_id).to_params