diff options
author | Rémy Coutable <remy@rymai.me> | 2017-09-26 14:28:38 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-09-26 14:28:38 +0000 |
commit | 6d1498ab4e80a73931f48d60c1604b9ff3617367 (patch) | |
tree | 5abd09825fb1f471306f48f89be605fd9575201d /lib/api/entities.rb | |
parent | d0606b5ff4a7f2ce9209583d7e45a2266ab09cd3 (diff) | |
parent | a019369409e38ee6cb36e5782cefd8c944b12e53 (diff) | |
download | gitlab-ce-6d1498ab4e80a73931f48d60c1604b9ff3617367.tar.gz |
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
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 085d1edc0fc..7f4736a08cb 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -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 |