mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-26 21:55:28 +01:00
Fix pagination
This commit is contained in:
parent
b02df1803e
commit
167812a3f2
@ -16,6 +16,9 @@ defmodule Pleroma.Pagination do
|
|||||||
|
|
||||||
@default_limit 20
|
@default_limit 20
|
||||||
@max_limit 40
|
@max_limit 40
|
||||||
|
@page_keys ["max_id", "min_id", "limit", "since_id", "order"]
|
||||||
|
|
||||||
|
def page_keys, do: @page_keys
|
||||||
|
|
||||||
@spec fetch_paginated(Ecto.Query.t(), map(), type(), atom() | nil) :: [Ecto.Schema.t()]
|
@spec fetch_paginated(Ecto.Query.t(), map(), type(), atom() | nil) :: [Ecto.Schema.t()]
|
||||||
def fetch_paginated(query, params, type \\ :keyset, table_binding \\ nil)
|
def fetch_paginated(query, params, type \\ :keyset, table_binding \\ nil)
|
||||||
|
@ -238,6 +238,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|
|||||||
params
|
params
|
||||||
|> Map.drop(["nickname", "page"])
|
|> Map.drop(["nickname", "page"])
|
||||||
|> Map.put("include_poll_votes", true)
|
|> Map.put("include_poll_votes", true)
|
||||||
|
|> Map.new(fn {k, v} -> {String.to_existing_atom(k), v} end)
|
||||||
|
|
||||||
activities = ActivityPub.fetch_user_activities(user, for_user, params)
|
activities = ActivityPub.fetch_user_activities(user, for_user, params)
|
||||||
|
|
||||||
@ -354,6 +355,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|
|||||||
|> Map.drop(["nickname", "page"])
|
|> Map.drop(["nickname", "page"])
|
||||||
|> Map.put("blocking_user", user)
|
|> Map.put("blocking_user", user)
|
||||||
|> Map.put("user", user)
|
|> Map.put("user", user)
|
||||||
|
|> Map.new(fn {k, v} -> {String.to_existing_atom(k), v} end)
|
||||||
|
|
||||||
activities =
|
activities =
|
||||||
[user.ap_id | User.following(user)]
|
[user.ap_id | User.following(user)]
|
||||||
|
Loading…
Reference in New Issue
Block a user