mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-14 03:24:04 +00:00
59333f2d56
MastodonAPI.Admin.AccountView → AdminAPI.AccountView See merge request pleroma/pleroma!930
30 lines
791 B
Elixir
30 lines
791 B
Elixir
# Pleroma: A lightweight social networking server
|
|
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
defmodule Pleroma.Web.AdminAPI.AccountView do
|
|
use Pleroma.Web, :view
|
|
|
|
alias Pleroma.User.Info
|
|
alias Pleroma.Web.AdminAPI.AccountView
|
|
|
|
def render("index.json", %{users: users, count: count, page_size: page_size}) do
|
|
%{
|
|
users: render_many(users, AccountView, "show.json", as: :user),
|
|
count: count,
|
|
page_size: page_size
|
|
}
|
|
end
|
|
|
|
def render("show.json", %{user: user}) do
|
|
%{
|
|
"id" => user.id,
|
|
"nickname" => user.nickname,
|
|
"deactivated" => user.info.deactivated,
|
|
"local" => user.local,
|
|
"roles" => Info.roles(user.info),
|
|
"tags" => user.tags || []
|
|
}
|
|
end
|
|
end
|