Commit fb1e7eae authored by Alfredo Sumaran's avatar Alfredo Sumaran

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.
parent 5e937896
...@@ -26,4 +26,8 @@ class GroupEntity < Grape::Entity ...@@ -26,4 +26,8 @@ class GroupEntity < Grape::Entity
expose :can_edit do |group| expose :can_edit do |group|
can?(request.current_user, :admin_group, group) can?(request.current_user, :admin_group, group)
end end
expose :has_subgroups do |group|
group.children.any?
end
end end
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