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:
mfo 2024-05-15 14:36:52 +02:00
parent 40e952e8d2
commit 50735919c8
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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