Fix get entreprise 404 not found
This commit is contained in:
parent
a37320bae9
commit
9bf8005658
2 changed files with 6 additions and 0 deletions
|
@ -2,4 +2,6 @@ class Entreprise < ActiveRecord::Base
|
|||
belongs_to :dossier
|
||||
has_one :etablissement, dependent: :destroy
|
||||
has_one :rna_information, dependent: :destroy
|
||||
|
||||
validates_presence_of :siren
|
||||
end
|
||||
|
|
|
@ -9,6 +9,10 @@ class DossierService
|
|||
def dossier_informations!
|
||||
@entreprise_adapter = SIADE::EntrepriseAdapter.new(DossierService.siren @siret)
|
||||
|
||||
if @entreprise_adapter.to_params.nil?
|
||||
raise RestClient::ResourceNotFound
|
||||
end
|
||||
|
||||
@dossier.create_entreprise(@entreprise_adapter.to_params)
|
||||
@etablissement_adapter = SIADE::EtablissementAdapter.new(@siret)
|
||||
|
||||
|
|
Loading…
Reference in a new issue