diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2019-12-30 11:30:20 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-03-01 12:01:39 +0300 |
commit | 32d1e048178a94017c9d8cca79b28272fa6da9f4 (patch) | |
tree | 9034f3345b3d731d895e7572262c75de9eeeee57 /lib/pleroma/pagination.ex | |
parent | 438394d40447bdfb590ff206ad80907294da0e65 (diff) | |
download | pleroma-32d1e048178a94017c9d8cca79b28272fa6da9f4.tar.gz |
ActivityPub actions & side-effects in transaction
Diffstat (limited to 'lib/pleroma/pagination.ex')
-rw-r--r-- | lib/pleroma/pagination.ex | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pleroma/pagination.ex b/lib/pleroma/pagination.ex index 43fb7babf..1307ad102 100644 --- a/lib/pleroma/pagination.ex +++ b/lib/pleroma/pagination.ex @@ -12,12 +12,15 @@ defmodule Pleroma.Pagination do alias Pleroma.Repo + @type type :: :keyset | :offset + @default_limit 20 @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()] def fetch_paginated(query, params, type \\ :keyset, table_binding \\ nil) def fetch_paginated(query, %{"total" => true} = params, :keyset, table_binding) do @@ -58,6 +61,7 @@ defmodule Pleroma.Pagination do |> Repo.all() end + @spec paginate(Ecto.Query.t(), map(), type(), atom() | nil) :: [Ecto.Schema.t()] def paginate(query, options, method \\ :keyset, table_binding \\ nil) def paginate(query, options, :keyset, table_binding) do |