mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Pleroma.Web.MastodonAPI.DomainBlockController: dialyzer errors
lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex:32:call The function call will not succeed. Phoenix.Controller.json( _conn :: %{ :assigns => %{:user => _, _ => _}, :body_params => %{:domain => _, _ => _}, _ => _ }, %{} ) breaks the contract (Plug.Conn.t(), term()) :: Plug.Conn.t() ________________________________________________________________________________ lib/pleroma/web/mastodon_api/controllers/domain_block_controller.ex:43:call The function call will not succeed. Phoenix.Controller.json( _conn :: %{ :assigns => %{:user => _, _ => _}, :body_params => %{:domain => _, _ => _}, _ => _ }, %{} ) breaks the contract (Plug.Conn.t(), term()) :: Plug.Conn.t()
This commit is contained in:
parent
3cb2807244
commit
378edeaf15
2 changed files with 4 additions and 4 deletions
|
@ -73,10 +73,10 @@ defmodule Pleroma.Web.ApiSpec.DomainBlockOperation do
|
||||||
%Schema{
|
%Schema{
|
||||||
type: :object,
|
type: :object,
|
||||||
properties: %{
|
properties: %{
|
||||||
domain: %Schema{type: :string}
|
"domain" => %Schema{type: :string}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: false,
|
required: true,
|
||||||
example: %{
|
example: %{
|
||||||
"domain" => "facebook.com"
|
"domain" => "facebook.com"
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ defmodule Pleroma.Web.MastodonAPI.DomainBlockController do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc "POST /api/v1/domain_blocks"
|
@doc "POST /api/v1/domain_blocks"
|
||||||
def create(%{assigns: %{user: blocker}, body_params: %{domain: domain}} = conn, _params) do
|
def create(%{assigns: %{user: blocker}, body_params: %{"domain" => domain}} = conn, _params) do
|
||||||
User.block_domain(blocker, domain)
|
User.block_domain(blocker, domain)
|
||||||
json(conn, %{})
|
json(conn, %{})
|
||||||
end
|
end
|
||||||
|
@ -38,7 +38,7 @@ defmodule Pleroma.Web.MastodonAPI.DomainBlockController do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc "DELETE /api/v1/domain_blocks"
|
@doc "DELETE /api/v1/domain_blocks"
|
||||||
def delete(%{assigns: %{user: blocker}, body_params: %{domain: domain}} = conn, _params) do
|
def delete(%{assigns: %{user: blocker}, body_params: %{"domain" => domain}} = conn, _params) do
|
||||||
User.unblock_domain(blocker, domain)
|
User.unblock_domain(blocker, domain)
|
||||||
json(conn, %{})
|
json(conn, %{})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue