feat(routing): can change defaut groupe

This commit is contained in:
simon lehericey 2023-04-07 15:44:23 +02:00
parent 95ab81fd1c
commit b38470368b
5 changed files with 51 additions and 1 deletions

View file

@ -12,6 +12,11 @@ module Administrateurs
groupe_instructeur.update!(routing_rule: ds_eq(left, right))
end
def update_defaut_groupe_instructeur
new_defaut = @procedure.groupe_instructeurs.find(defaut_groupe_instructeur_id)
@procedure.update!(defaut_groupe_instructeur: new_defaut)
end
private
def targeted_champ_changed?
@ -34,8 +39,12 @@ module Administrateurs
routing_params[:groupe_instructeur_id]
end
def defaut_groupe_instructeur_id
routing_params[:defaut_groupe_instructeur_id]
end
def routing_params
params.permit(:targeted_champ, :value, :groupe_instructeur_id)
params.permit(:targeted_champ, :value, :groupe_instructeur_id, :defaut_groupe_instructeur_id)
end
end
end