Mastodon admin API v2 improvements

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk 2026-02-27 22:34:18 +01:00 • committed by nicole mikołajczyk
commit 8626a337f8
4 changed files with 7 additions and 7 deletions

View file

@ -31,7 +31,7 @@ defmodule Pleroma.Web.ApiSpec.MastodonAdmin.AccountOperation do
:active, :active,
:query, :query,
:boolean, :boolean,
"Filter for currently active accounts??" "Filter for currently active accounts?"
), ),
Operation.parameter( Operation.parameter(
:pending, :pending,
@ -327,8 +327,8 @@ defmodule Pleroma.Web.ApiSpec.MastodonAdmin.AccountOperation do
} }
} }
}, },
locale: %Schema{type: :string, format: "date-time", nullable: true}, locale: %Schema{type: :string, nullable: true},
invite_request: %Schema{type: :string, format: "date-time", nullable: true}, invite_request: %Schema{type: :string, nullable: true},
role: %Schema{type: :string, nullable: true}, role: %Schema{type: :string, nullable: true},
confirmed: %Schema{type: :boolean}, confirmed: %Schema{type: :boolean},
approved: %Schema{type: :boolean}, approved: %Schema{type: :boolean},

View file

@ -119,11 +119,11 @@ defmodule Pleroma.Web.ApiSpec.MastodonAdmin.ReportOperation do
account: AccountOperation.account(), account: AccountOperation.account(),
target_account: AccountOperation.account(), target_account: AccountOperation.account(),
assigned_account: %Schema{ assigned_account: %Schema{
type: AccountOperation.account(), oneOf: [AccountOperation.account()],
nullable: true nullable: true
}, },
action_taken_by_account: %Schema{ action_taken_by_account: %Schema{
type: AccountOperation.account(), oneOf: [AccountOperation.account()],
nullable: true nullable: true
}, },
statuses: %Schema{ statuses: %Schema{

View file

@ -65,7 +65,7 @@ defmodule Pleroma.Web.MastodonAPI.Admin.ReportController do
subject_actor: report.user_actor subject_actor: report.user_actor
}) })
render(conn, "show.json", Report.extract_report_info(activity)) render(conn, "show.json", Report.extract_report_info(report))
else else
{:error, error} -> {:error, error} ->
json_response(conn, :bad_request, %{error: error}) json_response(conn, :bad_request, %{error: error})

View file

@ -236,7 +236,7 @@ defmodule Pleroma.Web.MastodonAPI.Admin.AccountControllerTest do
end end
end end
describe "POST /api/v1/admin/accounts/:id/rejct" do describe "POST /api/v1/admin/accounts/:id/reject" do
test "reject account", %{conn: conn} do test "reject account", %{conn: conn} do
%{id: id} = user = insert(:user, is_approved: false) %{id: id} = user = insert(:user, is_approved: false)