Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-11-22 06:45:15 +0300
committerRobert Speicher <robert@gitlab.com>2015-11-22 06:45:15 +0300
commitb166ee6b1d6113642388bd5dc1b95fb53fc69d7b (patch)
tree26a332bf4fddaa5ba6f02b1268d9689df9b85154 /lib
parent9155c82fdc075b7a3ef7f45224cbe5382c2ec7f9 (diff)
parent26b12e2c374c8f07abda06a8b19bd116448325f4 (diff)
Merge branch 'fix-award-emoji-api' into 'master'
Add upvote/downvote fields to merge request and note API to preserve compatibility As discussed in !1825 we should not break the API compatibility. * This MR adds the fields `upvotes`/`downvotes` to the merge request API again, which always return `0`. * Add the fields `upvote`/`downvote` to the notes API, which always return `false` This behavior is documented in the API docs. See merge request !1867
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 5dea74db295..9f337bc3cc6 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -163,6 +163,8 @@ module API
class MergeRequest < ProjectEntity
expose :target_branch, :source_branch
+ # deprecated, always returns 0
+ expose :upvotes, :downvotes
expose :author, :assignee, using: Entities::UserBasic
expose :source_project_id, :target_project_id
expose :label_names, as: :labels
@@ -192,6 +194,9 @@ module API
expose :author, using: Entities::UserBasic
expose :created_at
expose :system?, as: :system
+ # upvote? and downvote? are deprecated, always return false
+ expose :upvote?, as: :upvote
+ expose :downvote?, as: :downvote
end
class MRNote < Grape::Entity