#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

@@ -602,7 +602,7 @@ defmodule Mobilizon.Events do
|> filter_local_or_from_followed_instances_events()
|> filter_public_visibility()
|> event_order(Map.get(args, :sort_by, :match_desc), search_string)
|> Page.build_page(page, limit, :begins_on)
|> Page.build_page(page, limit)
end
@doc """