diff options
author | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-06-27 17:35:35 -0300 |
---|---|---|
committer | Oswaldo Ferreira <oswaldo@gitlab.com> | 2017-06-28 15:50:29 -0300 |
commit | da3e4f412846b754d31439da0d884181653bced0 (patch) | |
tree | e1c6da18204cf5c7990c350c5b9c01501ff60192 /lib/api | |
parent | 9f44687a14d57fec596b9736584bf8718df75a2e (diff) | |
download | gitlab-ce-da3e4f412846b754d31439da0d884181653bced0.tar.gz |
Add "members_count" and "parent_id" data on namespaces API
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index aa91451c9f4..2fe5280bc1c 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -444,7 +444,11 @@ module API end class Namespace < Grape::Entity - expose :id, :name, :path, :kind, :full_path + expose :id, :name, :path, :kind, :full_path, :parent_id + + expose :members_count do |namespace, _| + namespace.users_with_descendants.count if namespace.kind == 'group' + end end class MemberAccess < Grape::Entity |