fix(for_tiers): do not update for_tiers column to render the form. otherwise user could switch to dossier.for_tiers without filling mandataire required fields when he updates his identity
This commit is contained in:
parent
40e952e8d2
commit
50735919c8
2 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
= form_for @dossier, url: update_identite_dossier_path(@dossier), html: { id: 'identite-form', class: "form", "data-controller" => "for-tiers" } do |f|
|
||||
= f.hidden_field :for_tiers
|
||||
- if for_tiers?
|
||||
.fr-alert.fr-alert--info.fr-mb-2w
|
||||
%p.fr-notice__text
|
||||
|
|
|
@ -139,7 +139,7 @@ module Users
|
|||
respond_to do |format|
|
||||
format.html
|
||||
format.turbo_stream do
|
||||
@dossier.update_columns(params.require(:dossier).permit(:for_tiers).to_h)
|
||||
@dossier.for_tiers = params[:dossier][:for_tiers]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue