diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-11 03:09:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-11 03:09:06 +0300 |
commit | a9104a50136e485c8dda7af37106332f9010a1e8 (patch) | |
tree | 26880b70033a0952d7801c9554b99cea827820dd /lib/api/entities/namespace_basic.rb | |
parent | 696b36294520f8a311586f99e838b6a61b1b3f32 (diff) |
Add latest changes from gitlab-org/gitlab@master76926-follow-up-from-resolve-multi-selection-for-delete-on-registry-page
Diffstat (limited to 'lib/api/entities/namespace_basic.rb')
-rw-r--r-- | lib/api/entities/namespace_basic.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/api/entities/namespace_basic.rb b/lib/api/entities/namespace_basic.rb new file mode 100644 index 00000000000..f968a074bd2 --- /dev/null +++ b/lib/api/entities/namespace_basic.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module API + module Entities + class NamespaceBasic < Grape::Entity + 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 + end +end |