alias Pleroma.Repo
@default_limit 20
+ @page_keys ["max_id", "min_id", "limit", "since_id", "order"]
+
+ def page_keys, do: @page_keys
def fetch_paginated(query, params, type \\ :keyset)
@doc "GET /api/v1/favourites"
def favourites(%{assigns: %{user: user}} = conn, params) do
- activities = ActivityPub.fetch_favourites([], user, Map.take(params, ["limit"]))
+ activities =
+ ActivityPub.fetch_favourites(
+ [],
+ user,
+ Map.take(params, Pleroma.Pagination.page_keys())
+ )
conn
|> add_link_headers(activities)