diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-11-26 15:19:01 -0600 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-11-26 15:19:01 -0600 |
commit | 6c0484d571e4ed4e39fa3f88e6e1d2d7b8de96fa (patch) | |
tree | 060de963fb213e8139c2eac39ab806470380ec7d /lib/pleroma/web/api_spec/operations/admin | |
parent | e28d990ecba287d5c44ed04c0039b43c8f309e50 (diff) | |
download | pleroma-6c0484d571e4ed4e39fa3f88e6e1d2d7b8de96fa.tar.gz pleroma-6c0484d571e4ed4e39fa3f88e6e1d2d7b8de96fa.zip |
AdminAPI: suggest a user through the API
Diffstat (limited to 'lib/pleroma/web/api_spec/operations/admin')
-rw-r--r-- | lib/pleroma/web/api_spec/operations/admin/user_operation.ex | 66 |
1 files changed, 65 insertions, 1 deletions
diff --git a/lib/pleroma/web/api_spec/operations/admin/user_operation.ex b/lib/pleroma/web/api_spec/operations/admin/user_operation.ex index c9d0bfd7c..57fb1ad65 100644 --- a/lib/pleroma/web/api_spec/operations/admin/user_operation.ex +++ b/lib/pleroma/web/api_spec/operations/admin/user_operation.ex @@ -216,7 +216,71 @@ defmodule Pleroma.Web.ApiSpec.Admin.UserOperation do request_body( "Parameters", %Schema{ - description: "POST body for deleting multiple users", + description: "POST body for approving multiple users", + type: :object, + properties: %{ + nicknames: %Schema{ + type: :array, + items: %Schema{type: :string} + } + } + } + ), + responses: %{ + 200 => + Operation.response("Response", "application/json", %Schema{ + type: :object, + properties: %{user: %Schema{type: :array, items: user()}} + }), + 403 => Operation.response("Forbidden", "application/json", ApiError) + } + } + end + + def suggest_operation do + %Operation{ + tags: ["User administration"], + summary: "Suggest multiple users", + operationId: "AdminAPI.UserController.suggest", + security: [%{"oAuth" => ["admin:write:accounts"]}], + parameters: admin_api_params(), + requestBody: + request_body( + "Parameters", + %Schema{ + description: "POST body for adding multiple suggested users", + type: :object, + properties: %{ + nicknames: %Schema{ + type: :array, + items: %Schema{type: :string} + } + } + } + ), + responses: %{ + 200 => + Operation.response("Response", "application/json", %Schema{ + type: :object, + properties: %{user: %Schema{type: :array, items: user()}} + }), + 403 => Operation.response("Forbidden", "application/json", ApiError) + } + } + end + + def unsuggest_operation do + %Operation{ + tags: ["User administration"], + summary: "Unsuggest multiple users", + operationId: "AdminAPI.UserController.unsuggest", + security: [%{"oAuth" => ["admin:write:accounts"]}], + parameters: admin_api_params(), + requestBody: + request_body( + "Parameters", + %Schema{ + description: "POST body for removing multiple suggested users", type: :object, properties: %{ nicknames: %Schema{ |