diff options
author | Phil Hughes <me@iamphill.com> | 2016-07-27 20:34:04 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-07-27 20:34:04 +0300 |
commit | 2247d8a4fd7f77e1a4b8a50becdd08643435f19d (patch) | |
tree | 7a3e9c5769894b1e04cb66a95f7192ebd1d80e4c /app/controllers/projects/notes_controller.rb | |
parent | 86446846e963ea1304b56fa74b4ca795a491bbb5 (diff) |
Updates the text above discussions when resolving notes & discussions
Diffstat (limited to 'app/controllers/projects/notes_controller.rb')
-rw-r--r-- | app/controllers/projects/notes_controller.rb | 11 |
1 files changed, 9 insertions, 2 deletions
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 |