diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-10 00:24:54 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-07-21 22:35:24 +0300 |
commit | 76c3d2d434d3c550c3de912abc0a5b1dc1455368 (patch) | |
tree | caf45606608993ccd660c8cab45ef387fbf9756e /app/controllers/projects/issues_controller.rb | |
parent | cb2287df0ad9396d1f075bde1c4f6de481d908e6 (diff) |
Add full JSON endpoints for issue notes and discussions
Diffstat (limited to 'app/controllers/projects/issues_controller.rb')
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 0ac9da2ff0f..153c490ce3f 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -97,6 +97,14 @@ class Projects::IssuesController < Projects::ApplicationController end end + def discussions + @discussions = @issue.discussions + @discussions.reject! { |d| d.individual_note? && d.first_note.cross_reference_not_visible_for?(current_user) } + prepare_notes_for_rendering(@discussions.flat_map(&:notes)) + + render json: DiscussionSerializer.new(project: @project, noteable: @issue, current_user: current_user).represent(@discussions) + end + def create create_params = issue_params.merge(spammable_params).merge( merge_request_to_resolve_discussions_of: params[:merge_request_to_resolve_discussions_of], |