Add pagination to AdminAPI.AnnouncementController.index
This commit is contained in:
parent
11a1996bf5
commit
eb1a29640f
4 changed files with 78 additions and 2 deletions
|
|
@ -61,6 +61,13 @@ defmodule Pleroma.Announcement do
|
|||
|> Repo.all()
|
||||
end
|
||||
|
||||
def list_paginated(%{limit: limited_number, offset: offset_number}) do
|
||||
__MODULE__
|
||||
|> limit(^limited_number)
|
||||
|> offset(^offset_number)
|
||||
|> Repo.all()
|
||||
end
|
||||
|
||||
def get_by_id(id) do
|
||||
Repo.get_by(__MODULE__, id: id)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue