commit: 59333f2d568dc6e50fb72e5114ec7dd6bcc1ebef
parent: 86871c8a04e8667dc86e9ef372701109ed853d00
Author: kaniini <nenolod@gmail.com>
Date: Thu, 14 Mar 2019 02:01:10 +0000
Merge branch 'admin-api-account-view-namespace' into 'develop'
MastodonAPI.Admin.AccountView → AdminAPI.AccountView
See merge request pleroma/pleroma!930
Diffstat:
3 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/lib/pleroma/web/admin_api/admin_api_controller.ex b/lib/pleroma/web/admin_api/admin_api_controller.ex
@@ -8,7 +8,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
use Pleroma.Web, :controller
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Relay
- alias Pleroma.Web.MastodonAPI.Admin.AccountView
+ alias Pleroma.Web.AdminAPI.AccountView
import Pleroma.Web.ControllerHelper, only: [json_response: 3]
diff --git a/lib/pleroma/web/admin_api/views/account_view.ex b/lib/pleroma/web/admin_api/views/account_view.ex
@@ -0,0 +1,29 @@
+# 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
diff --git a/lib/pleroma/web/mastodon_api/views/admin/account_view.ex b/lib/pleroma/web/mastodon_api/views/admin/account_view.ex
@@ -1,29 +0,0 @@
-# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
-# SPDX-License-Identifier: AGPL-3.0-only
-
-defmodule Pleroma.Web.MastodonAPI.Admin.AccountView do
- use Pleroma.Web, :view
-
- alias Pleroma.User.Info
- alias Pleroma.Web.MastodonAPI.Admin.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