Fix incorrect report count

This commit is contained in:
Maxim Filippov 2019-12-06 17:17:24 +09:00
commit 08c89fd2b8
3 changed files with 11 additions and 4 deletions

View file

@ -35,7 +35,10 @@ defmodule Pleroma.Pagination do
end
def fetch_paginated(query, %{"total" => true} = params, :offset) do
total = Repo.aggregate(query, :count, :id)
total =
query
|> Ecto.Query.exclude(:left_join)
|> Repo.aggregate(:count, :id)
%{
total: total,