2023-08-28 14:56:52 +02:00
|
|
|
module Administrateurs
|
|
|
|
class ChorusController < AdministrateurController
|
|
|
|
before_action :retrieve_procedure
|
|
|
|
|
|
|
|
def edit
|
|
|
|
end
|
2023-08-29 09:22:58 +02:00
|
|
|
|
|
|
|
def update
|
|
|
|
@configuration = @procedure.chorus_configuration
|
|
|
|
@configuration.assign_attributes(configurations_params)
|
|
|
|
if @configuration.valid?
|
|
|
|
@procedure.update!(chorus: @configuration.attributes)
|
|
|
|
|
|
|
|
flash.notice = "La configuration Chorus a été mise à jour et prend immédiatement effet pour les nouveaux dossiers."
|
|
|
|
redirect_to admin_procedure_path(@procedure)
|
|
|
|
else
|
|
|
|
flash.now.alert = "Des erreurs empêchent la validation du connecteur chorus. Corrigez les erreurs"
|
|
|
|
render :edit
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2023-09-06 17:16:02 +02:00
|
|
|
def search_params
|
|
|
|
params.permit(:q)
|
|
|
|
end
|
|
|
|
|
2023-08-29 09:22:58 +02:00
|
|
|
def configurations_params
|
2023-09-06 17:16:02 +02:00
|
|
|
params.require(:chorus_configuration)
|
|
|
|
.permit(:centre_de_coup, :domaine_fonctionnel, :referentiel_de_programmation)
|
2023-08-29 09:22:58 +02:00
|
|
|
end
|
2023-08-28 14:56:52 +02:00
|
|
|
end
|
|
|
|
end
|