#1308 update build_page() to permit query with group_by()

Using Repo.aggregate() to count the total of elements is incompatible with group_by().

Changing this to a subquery with a count(*) of results permit to use group_by().
This commit is contained in:
Massedil
2024-10-24 18:54:02 +02:00
parent 9403a9d60a
commit 41aa81097d
3 changed files with 16 additions and 5 deletions

View File

@@ -73,7 +73,7 @@ defmodule Mobilizon.Instances do
query
end
%Page{elements: elements} = paged_instances = Page.build_page(query, page, limit, :domain)
%Page{elements: elements} = paged_instances = Page.build_page(query, page, limit)
%Page{
paged_instances