summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb4
-rw-r--r--lib/api/projects.rb9
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 8b4519af2d1..9fa8506926c 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -187,5 +187,9 @@ module API
end
end
end
+
+ class Label < Grape::Entity
+ expose :name
+ end
end
end
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 4d48d2194f8..40b5ce86c93 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -215,6 +215,15 @@ module API
@users = paginate @users
present @users, with: Entities::User
end
+
+ # Get a labels list
+ #
+ # Example Request:
+ # GET /users
+ get ':id/labels' do
+ @labels = user_project.issues_labels
+ present @labels, with: Entities::Label
+ end
end
end
end