From e34710b9888d5a3602971111c3a376bf8442fb84 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 4 Mar 2019 21:33:53 +0300 Subject: [PATCH] Format & update docs --- docs/Admin-API.md | 35 +++---------------- .../admin_api/admin_api_controller_test.exs | 10 +++--- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/docs/Admin-API.md b/docs/Admin-API.md index 407647645..7f60b768a 100644 --- a/docs/Admin-API.md +++ b/docs/Admin-API.md @@ -2,41 +2,16 @@ Authentication is required and the user must be an admin. -## `/api/pleroma/admin/users` +## `/api/pleroma/admin/users?query={query}&local={local}&page={page}&page_size={page_size}` ### List users - Method `GET` - Params: - - `page`: **integer** page number - - `page_size`: **integer** number of users per page (default is `50`) -- Response: - -```JSON -{ - "page_size": integer, - "count": integer, - "users": [ - { - "deactivated": bool, - "id": integer, - "nickname": string - }, - ... - ] -} -``` - -## `/api/pleroma/admin/users/search?query={query}&local={local}&page={page}&page_size={page_size}` - -### Search users by name or nickname - -- Method `GET` -- Params: - - `query`: **string** search term - - `local`: **bool** whether to return only local users - - `page`: **integer** page number - - `page_size`: **integer** number of users per page (default is `50`) + - `query`: **string** *optional* search term + - `local`: **bool** *optional* whether to return only local users + - `page`: **integer** *optional* page number + - `page_size`: **integer** *optional* number of users per page (default is `50`) - Response: ```JSON diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs index dd40b4a06..1b8b4d4b7 100644 --- a/test/web/admin_api/admin_api_controller_test.exs +++ b/test/web/admin_api/admin_api_controller_test.exs @@ -476,11 +476,11 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do "count" => 2, "page_size" => 50, "users" => [ - %{ - "deactivated" => admin.info.deactivated, - "id" => admin.id, - "nickname" => admin.nickname - }, + %{ + "deactivated" => admin.info.deactivated, + "id" => admin.id, + "nickname" => admin.nickname + }, %{ "deactivated" => user.info.deactivated, "id" => user.id,