change create avis concern
This commit is contained in:
parent
60c06b6d8c
commit
436f567067
1 changed files with 3 additions and 2 deletions
|
@ -9,7 +9,8 @@ module CreateAvisConcern
|
|||
# the :emails parameter is a 1-element array.
|
||||
# Hence the call to first
|
||||
# https://github.com/rails/rails/issues/17225
|
||||
expert_emails = create_avis_params[:emails].first.split(',').map(&:strip)
|
||||
expert_emails = create_avis_params[:emails].presence || [].to_json
|
||||
expert_emails = JSON.parse(expert_emails).map(&:strip).map(&:downcase)
|
||||
allowed_dossiers = [dossier]
|
||||
|
||||
if create_avis_params[:invite_linked_dossiers].present?
|
||||
|
@ -65,6 +66,6 @@ module CreateAvisConcern
|
|||
end
|
||||
|
||||
def create_avis_params
|
||||
params.require(:avis).permit(:introduction_file, :introduction, :confidentiel, :invite_linked_dossiers, emails: [])
|
||||
params.require(:avis).permit(:introduction_file, :introduction, :confidentiel, :invite_linked_dossiers, :emails)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue