From ac06a476896831ce74e87cd5d3b889d34426ad73 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 30 Jan 2024 14:14:22 -0500 Subject: [PATCH] Revert "Pleroma.Web.AdminAPI.RelayController: dialyzer errors" This reverts commit 94838ed941494fb6132086aa2cb3b5e65a00b08c. --- .../web/admin_api/controllers/relay_controller.ex | 9 +++------ .../web/api_spec/operations/admin/relay_operation.ex | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/pleroma/web/admin_api/controllers/relay_controller.ex b/lib/pleroma/web/admin_api/controllers/relay_controller.ex index 664011b06..2e83fe139 100644 --- a/lib/pleroma/web/admin_api/controllers/relay_controller.ex +++ b/lib/pleroma/web/admin_api/controllers/relay_controller.ex @@ -31,7 +31,7 @@ def index(conn, _params) do end end - def follow(%{assigns: %{user: admin}, body_params: %{"relay_url" => target}} = conn, _) do + def follow(%{assigns: %{user: admin}, body_params: %{relay_url: target}} = conn, _) do with {:ok, _message} <- Relay.follow(target) do ModerationLog.insert_log(%{action: "relay_follow", actor: admin, target: target}) @@ -44,11 +44,8 @@ def follow(%{assigns: %{user: admin}, body_params: %{"relay_url" => target}} = c end end - def unfollow( - %{assigns: %{user: admin}, body_params: %{"relay_url" => target} = params} = conn, - _ - ) do - with {:ok, _message} <- Relay.unfollow(target, %{force: params["force"]}) do + def unfollow(%{assigns: %{user: admin}, body_params: %{relay_url: target} = params} = conn, _) do + with {:ok, _message} <- Relay.unfollow(target, %{force: params[:force]}) do ModerationLog.insert_log(%{action: "relay_unfollow", actor: admin, target: target}) json(conn, target) diff --git a/lib/pleroma/web/api_spec/operations/admin/relay_operation.ex b/lib/pleroma/web/api_spec/operations/admin/relay_operation.ex index ca9080fb3..8b241bd49 100644 --- a/lib/pleroma/web/api_spec/operations/admin/relay_operation.ex +++ b/lib/pleroma/web/api_spec/operations/admin/relay_operation.ex @@ -87,7 +87,7 @@ defp relay_url do %Schema{ type: :object, properties: %{ - "relay_url" => %Schema{type: :string, format: :uri} + relay_url: %Schema{type: :string, format: :uri} } } end @@ -96,8 +96,8 @@ defp relay_unfollow do %Schema{ type: :object, properties: %{ - "relay_url" => %Schema{type: :string, format: :uri}, - "force" => %Schema{type: :boolean, default: false} + relay_url: %Schema{type: :string, format: :uri}, + force: %Schema{type: :boolean, default: false} } } end