account_view.ex (681B)
1 # Pleroma: A lightweight social networking server 2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/> 3 # SPDX-License-Identifier: AGPL-3.0-only 4 5 defmodule Pleroma.Web.MastodonAPI.Admin.AccountView do 6 use Pleroma.Web, :view 7 8 alias Pleroma.Web.MastodonAPI.Admin.AccountView 9 10 def render("index.json", %{users: users, count: count, page_size: page_size}) do 11 %{ 12 users: render_many(users, AccountView, "show.json", as: :user), 13 count: count, 14 page_size: page_size 15 } 16 end 17 18 def render("show.json", %{user: user}) do 19 %{ 20 "id" => user.id, 21 "nickname" => user.nickname, 22 "deactivated" => user.info.deactivated 23 } 24 end 25 end