Revert "Pleroma.Web.AdminAPI.RelayController: dialyzer errors"
This reverts commit 94838ed941
.
This commit is contained in:
parent
da5e0fca4f
commit
ac06a47689
@ -31,7 +31,7 @@ defmodule Pleroma.Web.AdminAPI.RelayController do
|
|||||||
end
|
end
|
||||||
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
|
with {:ok, _message} <- Relay.follow(target) do
|
||||||
ModerationLog.insert_log(%{action: "relay_follow", actor: admin, target: target})
|
ModerationLog.insert_log(%{action: "relay_follow", actor: admin, target: target})
|
||||||
|
|
||||||
@ -44,11 +44,8 @@ defmodule Pleroma.Web.AdminAPI.RelayController do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def unfollow(
|
def unfollow(%{assigns: %{user: admin}, body_params: %{relay_url: target} = params} = conn, _) do
|
||||||
%{assigns: %{user: admin}, body_params: %{"relay_url" => target} = params} = conn,
|
with {:ok, _message} <- Relay.unfollow(target, %{force: params[:force]}) do
|
||||||
_
|
|
||||||
) do
|
|
||||||
with {:ok, _message} <- Relay.unfollow(target, %{force: params["force"]}) do
|
|
||||||
ModerationLog.insert_log(%{action: "relay_unfollow", actor: admin, target: target})
|
ModerationLog.insert_log(%{action: "relay_unfollow", actor: admin, target: target})
|
||||||
|
|
||||||
json(conn, target)
|
json(conn, target)
|
||||||
|
@ -87,7 +87,7 @@ defmodule Pleroma.Web.ApiSpec.Admin.RelayOperation do
|
|||||||
%Schema{
|
%Schema{
|
||||||
type: :object,
|
type: :object,
|
||||||
properties: %{
|
properties: %{
|
||||||
"relay_url" => %Schema{type: :string, format: :uri}
|
relay_url: %Schema{type: :string, format: :uri}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -96,8 +96,8 @@ defmodule Pleroma.Web.ApiSpec.Admin.RelayOperation do
|
|||||||
%Schema{
|
%Schema{
|
||||||
type: :object,
|
type: :object,
|
||||||
properties: %{
|
properties: %{
|
||||||
"relay_url" => %Schema{type: :string, format: :uri},
|
relay_url: %Schema{type: :string, format: :uri},
|
||||||
"force" => %Schema{type: :boolean, default: false}
|
force: %Schema{type: :boolean, default: false}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user