fix(dossier): should refresh dossier footer when removing options from multiselect

This commit is contained in:
Paul Chavard 2023-08-31 12:22:53 +02:00
parent dd85a495e0
commit 3a54e44b57
8 changed files with 28 additions and 13 deletions

View file

@ -5,8 +5,9 @@ class Champs::OptionsController < ApplicationController
def remove
champ = policy_scope(Champ).includes(:champs).find(params[:champ_id])
champ.remove_option([params[:option]].compact)
champ.remove_option([params[:option]].compact, true)
champs = champ.private? ? champ.dossier.champs_private_all : champ.dossier.champs_public_all
@dossier = champ.private? ? nil : champ.dossier
@to_show, @to_hide, @to_update = champs_to_turbo_update({ params[:champ_id] => true }, champs)
end
end