Add GET /api/pleroma/admin/relay endpoint - lists all followed relays
This commit is contained in:
parent
44afe4c887
commit
cc6875b582
8 changed files with 112 additions and 8 deletions
|
|
@ -401,6 +401,16 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
|
|||
end
|
||||
end
|
||||
|
||||
def relay_list(conn, _params) do
|
||||
with {:ok, list} <- Relay.list() do
|
||||
json(conn, %{relays: list})
|
||||
else
|
||||
_ ->
|
||||
conn
|
||||
|> put_status(500)
|
||||
end
|
||||
end
|
||||
|
||||
def relay_follow(%{assigns: %{user: admin}} = conn, %{"relay_url" => target}) do
|
||||
with {:ok, _message} <- Relay.follow(target) do
|
||||
ModerationLog.insert_log(%{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue