diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2018-12-28 12:47:00 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2019-01-31 15:49:51 +0300 |
commit | 27a19c515a6876f855a12400f5f8168a53664832 (patch) | |
tree | 6fca35d974d8d4ef011e57ff0358b9fda579357a /lib/api/entities.rb | |
parent | 70ed87bacd2dfffcb359235104f02d0905d612f0 (diff) |
Factor out group labels entity
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 4edec631e8d..25052a29c31 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1006,7 +1006,7 @@ module API expose :id, :name, :color, :description end - class Label < LabelBasic + class GroupLabel < LabelBasic expose :open_issues_count do |label, options| label.open_issues_count(options[:current_user]) end @@ -1019,15 +1019,17 @@ module API label.open_merge_requests_count(options[:current_user]) end - expose :priority do |label, options| - label.priority(options[:project]) - end - expose :subscribed do |label, options| label.subscribed?(options[:current_user], options[:project]) end end + class ProjectLabel < GroupLabel + expose :priority do |label, options| + label.priority(options[:project]) + end + end + class List < Grape::Entity expose :id expose :label, using: Entities::LabelBasic |