Supprime la possibilité pour l'expert invité d'envoyer un message à l'usager

This commit is contained in:
kara Diaby 2020-10-08 10:42:16 +02:00
parent f4fa557aca
commit 6636b7f14c
5 changed files with 1 additions and 67 deletions

View file

@ -6,7 +6,7 @@ module Instructeurs
before_action :check_if_avis_revoked, only: [:show]
before_action :redirect_if_no_sign_up_needed, only: [:sign_up]
before_action :check_avis_exists_and_email_belongs_to_avis, only: [:sign_up, :create_instructeur]
before_action :set_avis_and_dossier, only: [:show, :instruction, :messagerie, :create_commentaire, :update]
before_action :set_avis_and_dossier, only: [:show, :instruction, :update]
A_DONNER_STATUS = 'a-donner'
DONNES_STATUS = 'donnes'
@ -53,23 +53,6 @@ module Instructeurs
end
end
def messagerie
@commentaire = Commentaire.new
end
def create_commentaire
@commentaire = CommentaireService.build(current_instructeur, avis.dossier, commentaire_params)
if @commentaire.save
@commentaire.dossier.update!(last_commentaire_updated_at: Time.zone.now)
flash.notice = "Message envoyé"
redirect_to messagerie_instructeur_avis_path(avis.procedure, avis)
else
flash.alert = @commentaire.errors.full_messages
render :messagerie
end
end
def create_avis
@procedure = Procedure.find(params[:procedure_id])
if !feature_enabled_for?(:expert_not_allowed_to_invite, @procedure)