debian-mirror-gitlab/lib/api/entities/namespace_basic.rb

18 lines
396 B
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# 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|
2021-11-18 22:05:49 +05:30
if namespace.user_namespace?
2020-03-13 15:44:24 +05:30
Gitlab::Routing.url_helpers.user_url(namespace.owner)
else
namespace.web_url
end
end
end
end
end