summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2019-04-16 11:16:52 -0500
committerMayra Cabrera <mcabrera@gitlab.com>2019-04-18 19:00:48 -0500
commit1dd4a007804fa0e6ea00a00805d08808f6c0be3a (patch)
tree09a6b2520dfea63090b3375f02f36724639951e2 /lib
parent86be4a6f466205b415de74330dd495a2e8b3c9d0 (diff)
downloadgitlab-ce-1dd4a007804fa0e6ea00a00805d08808f6c0be3a.tar.gz
Adds namespace information to project endpoint39858-add-group-owned-info-to-projects-api
- Namespace now return avatar_url and web_url - NamespaceBasic entity was modified to include avatar_url and web_url, information is fetched differently depending if the Namespace is a user or a group Includes documentation changes Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/39858
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb10
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