FIX: Infinite loading more on groups page.
This commit is contained in:
parent
2baff71518
commit
9f216ac182
|
@ -59,9 +59,6 @@ class GroupsController < ApplicationController
|
|||
type_filters.delete(:automatic)
|
||||
end
|
||||
|
||||
count = groups.count
|
||||
groups = groups.offset(page * page_size).limit(page_size)
|
||||
|
||||
if Group.preloaded_custom_field_names.present?
|
||||
Group.preload_custom_fields(groups, Group.preloaded_custom_field_names)
|
||||
end
|
||||
|
@ -76,6 +73,9 @@ class GroupsController < ApplicationController
|
|||
owner_group_ids = group_users.where(owner: true).pluck(:group_id)
|
||||
end
|
||||
|
||||
count = groups.count
|
||||
groups = groups.offset(page * page_size).limit(page_size)
|
||||
|
||||
render_json_dump(
|
||||
groups: serialize_data(groups,
|
||||
BasicGroupSerializer,
|
||||
|
|
|
@ -128,6 +128,7 @@ describe GroupsController do
|
|||
response_body = JSON.parse(response.body)
|
||||
group_ids = response_body["groups"].map { |g| g["id"] }
|
||||
|
||||
expect(response_body["total_rows_groups"]).to eq(expected_group_ids.count)
|
||||
expect(group_ids).to contain_exactly(*expected_group_ids)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue