gitlab-org--gitlab-foss/lib/api/entities/namespace_basic.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
396 B
Ruby
Raw Normal View History

# 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_namespace?
Gitlab::Routing.url_helpers.user_url(namespace.owner)
else
namespace.web_url
end
end
end
end
end