Commit 9651457260ea1b9e0e458ed0afd3fed0a8991648
Exists in
master
and in
4 other branches
Merge branch 'mr_votes_api' of /home/git/repositories/gitlab/gitlabhq
Showing
2 changed files
with
9 additions
and
1 deletions
Show diff stats
doc/api/merge_requests.md
| ... | ... | @@ -20,6 +20,8 @@ Parameters: |
| 20 | 20 | "project_id":3, |
| 21 | 21 | "title":"test1", |
| 22 | 22 | "state":"opened", |
| 23 | + "upvotes":0, | |
| 24 | + "downvotes":0, | |
| 23 | 25 | "author":{ |
| 24 | 26 | "id":1, |
| 25 | 27 | "username": "admin", |
| ... | ... | @@ -62,6 +64,8 @@ Parameters: |
| 62 | 64 | "project_id":3, |
| 63 | 65 | "title":"test1", |
| 64 | 66 | "state":"merged", |
| 67 | + "upvotes":0, | |
| 68 | + "downvotes":0, | |
| 65 | 69 | "author":{ |
| 66 | 70 | "id":1, |
| 67 | 71 | "username": "admin", |
| ... | ... | @@ -106,6 +110,8 @@ Parameters: |
| 106 | 110 | "project_id":3, |
| 107 | 111 | "title":"test1", |
| 108 | 112 | "state":"opened", |
| 113 | + "upvotes":0, | |
| 114 | + "downvotes":0, | |
| 109 | 115 | "author":{ |
| 110 | 116 | "id":1, |
| 111 | 117 | "username": "admin", |
| ... | ... | @@ -152,6 +158,8 @@ Parameters: |
| 152 | 158 | "project_id":3, |
| 153 | 159 | "title":"test1", |
| 154 | 160 | "state":"opened", |
| 161 | + "upvotes":0, | |
| 162 | + "downvotes":0, | |
| 155 | 163 | "author":{ |
| 156 | 164 | "id":1, |
| 157 | 165 | "username": "admin", | ... | ... |
lib/api/entities.rb
| ... | ... | @@ -112,7 +112,7 @@ module API |
| 112 | 112 | end |
| 113 | 113 | |
| 114 | 114 | class MergeRequest < Grape::Entity |
| 115 | - expose :id, :target_branch, :source_branch, :title, :state | |
| 115 | + expose :id, :target_branch, :source_branch, :title, :state, :upvotes, :downvotes | |
| 116 | 116 | expose :target_project_id, as: :project_id |
| 117 | 117 | expose :author, :assignee, using: Entities::UserBasic |
| 118 | 118 | end | ... | ... |