fix test
authorMaksim Pechnikov <parallel588@gmail.com>
Mon, 18 Nov 2019 07:00:48 +0000 (10:00 +0300)
committerMaksim Pechnikov <parallel588@gmail.com>
Mon, 18 Nov 2019 07:00:48 +0000 (10:00 +0300)
lib/pleroma/pagination.ex
lib/pleroma/web/mastodon_api/controllers/status_controller.ex

index 9d279fba7939f12256d57cf41261f0e506fba562..c77ba78bb483fc7cbb785b7467849edd4eaa033e 100644 (file)
@@ -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)
 
index cdc4cec9c07d87f277e7b341afad660985cd260c..e11bee38368c24ed67d6054d1def711950bf30ba 100644 (file)
@@ -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)