summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/pleroma/web/admin_api/controllers/relay_controller.ex9
-rw-r--r--lib/pleroma/web/api_spec/operations/admin/relay_operation.ex6
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/pleroma/web/admin_api/controllers/relay_controller.ex b/lib/pleroma/web/admin_api/controllers/relay_controller.ex
index 2e83fe139..664011b06 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 @@ defmodule Pleroma.Web.AdminAPI.RelayController 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,8 +44,11 @@ defmodule Pleroma.Web.AdminAPI.RelayController do
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 8b241bd49..ca9080fb3 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 @@ defmodule Pleroma.Web.ApiSpec.Admin.RelayOperation do
%Schema{
type: :object,
properties: %{
- relay_url: %Schema{type: :string, format: :uri}
+ "relay_url" => %Schema{type: :string, format: :uri}
}
}
end
@@ -96,8 +96,8 @@ defmodule Pleroma.Web.ApiSpec.Admin.RelayOperation 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