Fix typo, update according to Mastodon docs

Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
mkljczk 2025-03-17 17:01:03 +01:00
parent 005e6b8e4f
commit 56af52e4f4
2 changed files with 27 additions and 17 deletions

View file

@ -221,7 +221,7 @@ defmodule Pleroma.Web.ApiSpec.MastodonAdmin.AccountOperation do
def account do
%Schema{
title: "AdminAccount",
title: "Admin::Account",
description: "Admin-level information about a given account.",
type: :object,
properties: %{
@ -231,16 +231,27 @@ defmodule Pleroma.Web.ApiSpec.MastodonAdmin.AccountOperation do
created_at: %Schema{type: :string, format: "date-time"},
email: %Schema{type: :string, format: "email", nullable: true},
ip: %Schema{type: :string, nullable: true},
role: %Schema{type: :string, nullable: true},
confirmed: %Schema{type: :boolean},
sensitized: %Schema{type: :boolean, nullable: true},
silenced: %Schema{type: :boolean, nullable: true},
suspened: %Schema{type: :boolean, nullable: true},
disabled: %Schema{type: :boolean},
approved: %Schema{type: :boolean},
ips: %Schema{
type: :array,
items: %Schema{
type: :object,
properties: %{
ip: %Schema{type: :string},
used_at: %Schema{type: :string, format: "date-time"}
}
}
},
locale: %Schema{type: :string, format: "date-time", nullable: true},
invite_request: %Schema{type: :string, format: "date-time", nullable: true},
account: Account
role: %Schema{type: :string, nullable: true},
confirmed: %Schema{type: :boolean},
approved: %Schema{type: :boolean},
disabled: %Schema{type: :boolean},
silenced: %Schema{type: :boolean, nullable: true},
suspended: %Schema{type: :boolean, nullable: true},
account: Account,
created_by_application_id: %Schema{type: :string, nullable: true},
invited_by_account_id: %Schema{type: :string, nullable: true}
}
}
end

View file

@ -24,16 +24,15 @@ defmodule Pleroma.Web.MastodonAPI.Admin.AccountView do
created_at: Utils.to_masto_date(user.inserted_at),
email: user.email,
ip: nil,
role: role(user),
confirmed: user.is_confirmed,
sensitized: nil,
suspened: nil,
silenced: nil,
disabled: !user.is_active,
approved: user.is_approved,
ips: [],
locale: nil,
invite_request: user.registration_reason,
ips: nil,
role: role(user),
confirmed: user.is_confirmed,
approved: user.is_approved,
disabled: !user.is_active,
silenced: nil,
suspended: nil,
account: account
}
end