Expose avatar URL for groups
This commit is contained in:
parent
bd95138414
commit
3427912ed4
|
@ -8,7 +8,7 @@ module GroupsHelper
|
|||
group = Group.find_by_full_path(group)
|
||||
end
|
||||
|
||||
group.try(:avatar_url) || image_path('no_group_avatar.png')
|
||||
group.try(:avatar_url) || ActionController::Base.helpers.image_path('no_group_avatar.png')
|
||||
end
|
||||
|
||||
def group_title(group, name = nil, url = nil)
|
||||
|
|
|
@ -2,9 +2,9 @@ class GroupEntity < Grape::Entity
|
|||
include ActionView::Helpers::NumberHelper
|
||||
include RequestAwareEntity
|
||||
include MembersHelper
|
||||
include GroupsHelper
|
||||
|
||||
expose :id, :name, :path, :description, :visibility
|
||||
expose :avatar_url
|
||||
expose :web_url
|
||||
expose :full_name, :full_path
|
||||
expose :parent_id
|
||||
|
@ -39,4 +39,8 @@ class GroupEntity < Grape::Entity
|
|||
expose :number_users_with_delimiter do |group|
|
||||
number_with_delimiter(group.users.count)
|
||||
end
|
||||
|
||||
expose :avatar_url do |group|
|
||||
group_icon(group)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue