Commit e6569def authored by Douwe Maan's avatar Douwe Maan

Use through-relation instead of manually mapping.

parent ff3caad4
...@@ -9,8 +9,7 @@ module API ...@@ -9,8 +9,7 @@ module API
# GET /groups/:id/members # GET /groups/:id/members
get ":id/members" do get ":id/members" do
group = find_group(params[:id]) group = find_group(params[:id])
members = group.group_members users = group.users
users = (paginate members).collect(&:user)
present users, with: Entities::GroupMember, group: group present users, with: Entities::GroupMember, group: group
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