Expose has_subgroups for groups endpoint
This is needed because we have to know before hand if the group has subgroups. If the group doesn’t have subgroups we will not let the user to click a group row to fetch subgroups, also we will hide caret icon which is used to indicate the row can be expanded.
This commit is contained in:
parent
5e9378961f
commit
fb1e7eae99
|
@ -26,4 +26,8 @@ class GroupEntity < Grape::Entity
|
|||
expose :can_edit do |group|
|
||||
can?(request.current_user, :admin_group, group)
|
||||
end
|
||||
|
||||
expose :has_subgroups do |group|
|
||||
group.children.any?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue