Merge pull request #1770 from tchak/api-adapter-object

Give procedure_id to SIRETService
This commit is contained in:
gregoirenovel 2018-03-29 18:10:42 +02:00 committed by GitHub
commit 846a2db661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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