BigW Consortium Gitlab

Commit 6d1498ab by Rémy Coutable

Merge branch 'dm-simple-project-avatar-url' into 'master'

Expose avatar_url when requesting list of projects from API with simple=true See merge request gitlab-org/gitlab-ce!14498
parents d0606b5f a0193694
---
title: Expose avatar_url when requesting list of projects from API with simple=true
merge_request:
author:
type: added
......@@ -89,6 +89,9 @@ module API
expose :ssh_url_to_repo, :http_url_to_repo, :web_url
expose :name, :name_with_namespace
expose :path, :path_with_namespace
expose :avatar_url do |project, options|
project.avatar_url(only_path: false)
end
expose :star_count, :forks_count
expose :created_at, :last_activity_at
end
......@@ -146,9 +149,7 @@ module API
expose :forked_from_project, using: Entities::BasicProjectDetails, if: lambda { |project, options| project.forked? }
expose :import_status
expose :import_error, if: lambda { |_project, options| options[:user_can_admin_project] }
expose :avatar_url do |user, options|
user.avatar_url(only_path: false)
end
expose :open_issues_count, if: lambda { |project, options| project.feature_available?(:issues, options[:current_user]) }
expose :runners_token, if: lambda { |_project, options| options[:user_can_admin_project] }
expose :public_builds, as: :public_jobs
......@@ -193,8 +194,8 @@ module API
class Group < Grape::Entity
expose :id, :name, :path, :description, :visibility
expose :lfs_enabled?, as: :lfs_enabled
expose :avatar_url do |user, options|
user.avatar_url(only_path: false)
expose :avatar_url do |group, options|
group.avatar_url(only_path: false)
end
expose :web_url
expose :request_access_enabled
......
......@@ -20,6 +20,7 @@ describe API::Environments do
path path_with_namespace
star_count forks_count
created_at last_activity_at
avatar_url
)
get api("/projects/#{project.id}/environments", user)
......
......@@ -193,6 +193,7 @@ describe API::Projects do
path path_with_namespace
star_count forks_count
created_at last_activity_at
avatar_url
)
get api('/projects?simple=true', user)
......
......@@ -89,6 +89,7 @@ describe API::V3::Projects do
path path_with_namespace
star_count forks_count
created_at last_activity_at
avatar_url
)
get v3_api('/projects?simple=true', user)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment