Merge pull request #10420 from mfo/US/fix-for-tiers
ETQ usager, je ne peux pas mettre mon dossier dans un etat invalide en essayant le bouton deposer pour un mandataire sans remplir les autres champs du mandataire
This commit is contained in:
commit
6e71a20257
3 changed files with 15 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|
|
= 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?
|
- if for_tiers?
|
||||||
.fr-alert.fr-alert--info.fr-mb-2w
|
.fr-alert.fr-alert--info.fr-mb-2w
|
||||||
%p.fr-notice__text
|
%p.fr-notice__text
|
||||||
|
|
|
@ -139,7 +139,7 @@ module Users
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
format.turbo_stream do
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Maintenance
|
||||||
|
class BackfillInvalidDossiersForTiersTask < MaintenanceTasks::Task
|
||||||
|
def collection
|
||||||
|
Dossier.where(for_tiers: true).where(mandataire_first_name: nil)
|
||||||
|
end
|
||||||
|
|
||||||
|
def process(element)
|
||||||
|
element.update_column(for_tiers: false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue