summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorStuart Pook <s.pook@criteo.com>2014-03-19 19:07:51 +0100
committerStuart Pook <s.pook@criteo.com>2014-03-19 19:07:51 +0100
commit9886998f24b3d6e44aafc412b87980cb1755544c (patch)
treed50b83e7b30b341006f63e7f41046228a077e4ea /lib/api
parentad3acff40990edf0ea3a380b8aa862098612f06a (diff)
downloadgitlab-ce-9886998f24b3d6e44aafc412b87980cb1755544c.tar.gz
Add method to get the comments on a merge request
Add method to get the comments for a merge request and document that you can change the status of 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: