From 2247d8a4fd7f77e1a4b8a50becdd08643435f19d Mon Sep 17 00:00:00 2001 From: Phil Hughes Date: Wed, 27 Jul 2016 18:34:04 +0100 Subject: Updates the text above discussions when resolving notes & discussions --- app/controllers/projects/notes_controller.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'app/controllers/projects/notes_controller.rb') diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb index ad7376b8574..59b8e88c8d7 100644 --- a/app/controllers/projects/notes_controller.rb +++ b/app/controllers/projects/notes_controller.rb @@ -72,8 +72,11 @@ class Projects::NotesController < Projects::ApplicationController note.resolve!(current_user) + discussion = note.noteable.discussions.find { |d| d.id == note.discussion_id } || render_404 + render json: { - resolved_by: note.resolved_by.try(:name) + resolved_by: note.resolved_by.try(:name), + updated_html: view_to_html_string('discussions/_headline', discussion: discussion) } end @@ -82,7 +85,11 @@ class Projects::NotesController < Projects::ApplicationController note.unresolve! - head :ok + discussion = note.noteable.discussions.find { |d| d.id == note.discussion_id } || render_404 + + render json: { + updated_html: view_to_html_string('discussions/_headline', discussion: discussion) + } end private -- cgit v1.2.1