diff options
Diffstat (limited to 'app/controllers/concerns/notes_actions.rb')
-rw-r--r-- | app/controllers/concerns/notes_actions.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/app/controllers/concerns/notes_actions.rb b/app/controllers/concerns/notes_actions.rb index 03ed5b5310b..fe9a030cdf2 100644 --- a/app/controllers/concerns/notes_actions.rb +++ b/app/controllers/concerns/notes_actions.rb @@ -41,7 +41,7 @@ module NotesActions @note = Notes::CreateService.new(note_project, current_user, create_params).execute if @note.is_a?(Note) - Notes::RenderService.new(current_user).execute([@note], @project) + Notes::RenderService.new(current_user).execute([@note]) end respond_to do |format| @@ -56,7 +56,7 @@ module NotesActions @note = Notes::UpdateService.new(project, current_user, note_params).execute(note) if @note.is_a?(Note) - Notes::RenderService.new(current_user).execute([@note], @project) + Notes::RenderService.new(current_user).execute([@note]) end respond_to do |format| @@ -212,12 +212,12 @@ module NotesActions end def note_serializer - NoteSerializer.new(project: project, noteable: noteable, current_user: current_user) + ProjectNoteSerializer.new(project: project, noteable: noteable, current_user: current_user) end def note_project strong_memoize(:note_project) do - return nil unless project + next nil unless project note_project_id = params[:note_project_id] @@ -228,7 +228,7 @@ module NotesActions project end - return access_denied! unless can?(current_user, :create_note, the_project) + next access_denied! unless can?(current_user, :create_note, the_project) the_project end @@ -237,10 +237,6 @@ module NotesActions def use_note_serializer? return false if params['html'] - if noteable.is_a?(MergeRequest) - cookies[:vue_mr_discussions] == 'true' - else - noteable.discussions_rendered_on_frontend? - end + noteable.discussions_rendered_on_frontend? end end |