diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-26 10:06:51 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-26 10:06:51 +0200 |
commit | 17fd0e5c724b2001549a049d7db2179cfd1b9a14 (patch) | |
tree | 56b7e450adde075648355d84c08ed966cc60158c /lib/api | |
parent | af0b59d477f7a9c314e17d3ceaf994f9cf5c4655 (diff) | |
parent | 9886998f24b3d6e44aafc412b87980cb1755544c (diff) | |
download | gitlab-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.rb | 16 |
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: |