diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-04-19 12:04:25 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2019-04-19 12:04:25 +0300 |
commit | 6376f78445300ee42c5a181f63e5b332d8266b0a (patch) | |
tree | 1d5716ab2080458920b39cadacc1926cd3db52c1 /lib | |
parent | 604cfb17a79b203dca7a2c56e84b58f8e819effd (diff) | |
parent | 1dd4a007804fa0e6ea00a00805d08808f6c0be3a (diff) |
Merge branch '39858-add-group-owned-info-to-projects-api' into 'master'
Return group information on Project endpoint
Closes #39858
See merge request gitlab-org/gitlab-ce!27427
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 4bdac278add..ee8480122c4 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -922,7 +922,15 @@ module API end class NamespaceBasic < Grape::Entity - expose :id, :name, :path, :kind, :full_path, :parent_id + expose :id, :name, :path, :kind, :full_path, :parent_id, :avatar_url + + expose :web_url do |namespace| + if namespace.user? + Gitlab::Routing.url_helpers.user_url(namespace.owner) + else + namespace.web_url + end + end end class Namespace < NamespaceBasic |