提交 fb1e7eae 编写于 作者: A 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.
上级 5e937896
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册