Merge branch 'develop' into feature/allow-user-query-via-id
authorMark Felder <feld@FreeBSD.org>
Tue, 9 Jul 2019 17:49:04 +0000 (12:49 -0500)
committerMark Felder <feld@FreeBSD.org>
Tue, 9 Jul 2019 17:49:04 +0000 (12:49 -0500)
CHANGELOG.md
docs/api/admin_api.md
lib/pleroma/web/admin_api/admin_api_controller.ex

index 2d59639bd5675008c96f9a9ecaa1c682299bc527..3473e8acbdcdfd90b72383e83f7ed2c352f67fc2 100644 (file)
@@ -8,9 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 - MRF: Support for priming the mediaproxy cache (`Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`)
 Configuration: `federation_incoming_replies_max_depth` option
 - Mastodon API: Support for the [`tagged` filter](https://github.com/tootsuite/mastodon/pull/9755) in [`GET /api/v1/accounts/:id/statuses`](https://docs.joinmastodon.org/api/rest/accounts/#get-api-v1-accounts-id-statuses)
+- Mastodon API, streaming: Add support for passing the token in the `Sec-WebSocket-Protocol` header
 - Admin API: Return users' tags when querying reports
 - Admin API: Return avatar and display name when querying users
-- Mastodon API, streaming: Add support for passing the token in the `Sec-WebSocket-Protocol` header
+- Admin API: Allow querying user by ID
 - Added synchronization of following/followers counters for external users
 
 ### Fixed
index 74bde3ecedf7351dad8221ada16c6db0d4c5179a..bce5e399bbedecc806f9c50f7171a108dade74c3 100644 (file)
@@ -176,13 +176,13 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
   - `nickname`
   - `status` BOOLEAN field, false value means deactivation.
 
-## `/api/pleroma/admin/users/:nickname`
+## `/api/pleroma/admin/users/:nickname_or_id`
 
 ### Retrive the details of a user
 
 - Method: `GET`
 - Params:
-  - `nickname`
+  - `nickname` or `id`
 - Response:
   - On failure: `Not found`
   - On success: JSON of the user
index 498beb56a02df7c05d01466414b1778e7cb2ced1..0a2482a8c85c45224d8d2916f503f8778ed4c381 100644 (file)
@@ -74,7 +74,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
   end
 
   def user_show(conn, %{"nickname" => nickname}) do
-    with %User{} = user <- User.get_cached_by_nickname(nickname) do
+    with %User{} = user <- User.get_cached_by_nickname_or_id(nickname) do
       conn
       |> json(AccountView.render("show.json", %{user: user}))
     else