From 4faeec2c449c73563635424b6a7d597b9222bfe2 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 8 Jun 2021 15:58:19 -0500 Subject: [PATCH] Create AdminAPI.UserView to avoid compile-time dep Speeds up recompilation --- .../web/admin_api/controllers/user_controller.ex | 2 -- lib/pleroma/web/admin_api/views/user_view.ex | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 lib/pleroma/web/admin_api/views/user_view.ex diff --git a/lib/pleroma/web/admin_api/controllers/user_controller.ex b/lib/pleroma/web/admin_api/controllers/user_controller.ex index d3e4c18a3..637a0e702 100644 --- a/lib/pleroma/web/admin_api/controllers/user_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/user_controller.ex @@ -45,8 +45,6 @@ defmodule Pleroma.Web.AdminAPI.UserController do when action in [:follow, :unfollow] ) - plug(:put_view, Pleroma.Web.AdminAPI.AccountView) - action_fallback(AdminAPI.FallbackController) defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.Admin.UserOperation diff --git a/lib/pleroma/web/admin_api/views/user_view.ex b/lib/pleroma/web/admin_api/views/user_view.ex new file mode 100644 index 000000000..e91265ffe --- /dev/null +++ b/lib/pleroma/web/admin_api/views/user_view.ex @@ -0,0 +1,10 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2021 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.Web.AdminAPI.UserView do + use Pleroma.Web, :view + alias Pleroma.Web.AdminAPI + + def render(view, opts), do: AdminAPI.AccountView.render(view, opts) +end -- 2.45.2