Browse Source

Admin API: Allow querying user by ID

tags/v1.1.4
Maxim Filippov 5 years ago
parent
commit
6c50fbcd14
3 changed files with 13 additions and 1 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +11
    -0
      docs/api/admin_api.md
  3. +1
    -1
      lib/pleroma/web/admin_api/admin_api_controller.ex

+ 1
- 0
CHANGELOG.md View File

@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- 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)
- Admin API: Return users' tags when querying reports
- Admin API: Return avatar and display name when querying users
- Admin API: Allow querying user by ID

### Fixed
- Not being able to pin unlisted posts


+ 11
- 0
docs/api/admin_api.md View File

@@ -187,6 +187,17 @@ Note: Available `:permission_group` is currently moderator and admin. 404 is ret
- On failure: `Not found`
- On success: JSON of the user

## `/api/pleroma/admin/users/:id`

### Retrive the details of a user

- Method: `GET`
- Params:
- `id`
- Response:
- On failure: `Not found`
- On success: JSON of the user

## `/api/pleroma/admin/relay`

### Follow a Relay


+ 1
- 1
lib/pleroma/web/admin_api/admin_api_controller.ex View 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


Loading…
Cancel
Save