1
0
Fork 0
forked from mirrors/akkoma

Do not try to guess which pagination we need by the existence of an :offset param.

Require explicit request to get offset pagination.
This commit is contained in:
Mark Felder 2021-01-04 10:13:17 -06:00
parent afe9c152ab
commit 83f27282ba
2 changed files with 3 additions and 6 deletions

View file

@ -603,11 +603,7 @@ def fetch_user_activities(user, reading_user, params \\ %{}) do
|> Map.put(:muting_user, reading_user)
end
pagination_type =
cond do
!Map.has_key?(params, :offset) -> :keyset
true -> :offset
end
pagination_type = Map.get(params, :pagination_type) || :keyset
%{
godmode: params[:godmode],

View file

@ -110,7 +110,8 @@ def list_user_statuses(%{assigns: %{user: admin}} = conn, %{"nickname" => nickna
limit: page_size,
offset: (page - 1) * page_size,
godmode: godmode,
exclude_reblogs: not with_reblogs
exclude_reblogs: not with_reblogs,
pagination_type: :offset
})
conn