From: Maksim Pechnikov Date: Mon, 18 Nov 2019 07:00:48 +0000 (+0300) Subject: fix test X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=9da4c88b49b4ccdc1eac90e04e9d8948fd943f37;p=akkoma fix test --- diff --git a/lib/pleroma/pagination.ex b/lib/pleroma/pagination.ex index 9d279fba7..c77ba78bb 100644 --- a/lib/pleroma/pagination.ex +++ b/lib/pleroma/pagination.ex @@ -13,6 +13,9 @@ defmodule Pleroma.Pagination do 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) diff --git a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex index cdc4cec9c..e11bee383 100644 --- a/lib/pleroma/web/mastodon_api/controllers/status_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/status_controller.ex @@ -346,7 +346,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do @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)