Fix test INSEE v2 get etablissement view
This commit is contained in:
parent
9332c0f6ed
commit
bd89688346
3 changed files with 13 additions and 2 deletions
|
@ -23,7 +23,12 @@ function the_terms() {
|
|||
}
|
||||
|
||||
function error_form_siret(invalid_siret){
|
||||
$("input[type='submit']").removeClass('btn-success').addClass('btn-danger').val('Erreur SIRET');
|
||||
setTimeout(function(){
|
||||
$("input[type='submit']").val('Erreur SIRET');
|
||||
}, 10);
|
||||
|
||||
$("input[type='submit']").removeClass('btn-success').addClass('btn-danger');
|
||||
|
||||
$("#dossier_siret").addClass('input-error').val(invalid_siret).on('input', reset_form_siret);
|
||||
|
||||
}
|
||||
|
|
|
@ -13,9 +13,13 @@ class DossierService
|
|||
raise RestClient::ResourceNotFound
|
||||
end
|
||||
|
||||
@dossier.create_entreprise(@entreprise_adapter.to_params)
|
||||
@etablissement_adapter = SIADE::EtablissementAdapter.new(@siret)
|
||||
|
||||
if @etablissement_adapter.to_params.nil?
|
||||
raise RestClient::ResourceNotFound
|
||||
end
|
||||
|
||||
@dossier.create_entreprise(@entreprise_adapter.to_params)
|
||||
@dossier.create_etablissement(@etablissement_adapter.to_params)
|
||||
|
||||
@rna_adapter = SIADE::RNAAdapter.new(@siret)
|
||||
|
|
|
@ -18,6 +18,8 @@ class SIADE::EtablissementAdapter
|
|||
params[k] = v if address_attribut_to_fetch.include?(k)
|
||||
end
|
||||
params
|
||||
rescue
|
||||
nil
|
||||
end
|
||||
|
||||
def attr_to_fetch
|
||||
|
|
Loading…
Reference in a new issue