summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-26 10:06:51 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-26 10:06:51 +0200
commit17fd0e5c724b2001549a049d7db2179cfd1b9a14 (patch)
tree56b7e450adde075648355d84c08ed966cc60158c /lib/api
parentaf0b59d477f7a9c314e17d3ceaf994f9cf5c4655 (diff)
parent9886998f24b3d6e44aafc412b87980cb1755544c (diff)
downloadgitlab-ce-17fd0e5c724b2001549a049d7db2179cfd1b9a14.tar.gz
Merge pull request #6569 from criteo/api_merge_request_comments
Add method to get the comments on a merge request
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/merge_requests.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index e2458198411..3a1a00d0719 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -125,6 +125,22 @@ module API
end
end
+ # Get a merge request's comments
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # merge_request_id (required) - ID of MR
+ # Examples:
+ # GET /projects/:id/merge_request/:merge_request_id/comments
+ #
+ get ":id/merge_request/:merge_request_id/comments" do
+ merge_request = user_project.merge_requests.find(params[:merge_request_id])
+
+ authorize! :read_merge_request, merge_request
+
+ present paginate(merge_request.notes), with: Entities::MRNote
+ end
+
# Post comment to merge request
#
# Parameters: