summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec/operations/admin
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2022-03-08 21:26:05 -0500
committerTusooa Zhu <tusooa@kazv.moe>2022-03-08 21:26:05 -0500
commiteb1a29640f2d7c7d3daca0626b2beb623903c9cd (patch)
treefb41f887f63c48c096eb548215b49a302317a265 /lib/pleroma/web/api_spec/operations/admin
parent11a1996bf5f283099fd9ecbb5c64e051ec46a5df (diff)
downloadpleroma-eb1a29640f2d7c7d3daca0626b2beb623903c9cd.tar.gz
pleroma-eb1a29640f2d7c7d3daca0626b2beb623903c9cd.zip
Add pagination to AdminAPI.AnnouncementController.index
Diffstat (limited to 'lib/pleroma/web/api_spec/operations/admin')
-rw-r--r--lib/pleroma/web/api_spec/operations/admin/announcement_operation.ex16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/pleroma/web/api_spec/operations/admin/announcement_operation.ex b/lib/pleroma/web/api_spec/operations/admin/announcement_operation.ex
index cdf04d357..58a039e72 100644
--- a/lib/pleroma/web/api_spec/operations/admin/announcement_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/admin/announcement_operation.ex
@@ -21,8 +21,24 @@ defmodule Pleroma.Web.ApiSpec.Admin.AnnouncementOperation do
summary: "Retrieve a list of announcements",
operationId: "AdminAPI.AnnouncementController.index",
security: [%{"oAuth" => ["admin:read"]}],
+ parameters: [
+ Operation.parameter(
+ :limit,
+ :query,
+ %Schema{type: :integer, minimum: 1},
+ "the maximum number of announcements to return"
+ ),
+ Operation.parameter(
+ :offset,
+ :query,
+ %Schema{type: :integer, minimum: 0},
+ "the offset of the first announcement to return"
+ )
+ | admin_api_params()
+ ],
responses: %{
200 => Operation.response("Response", "application/json", list_of_announcements()),
+ 400 => Operation.response("Forbidden", "application/json", ApiError),
403 => Operation.response("Forbidden", "application/json", ApiError)
}
}