Pleroma.Web.AdminAPI.MediaProxyCacheController: dialyzer errors
lib/pleroma/web/admin_api/controllers/media_proxy_cache_controller.ex:64:call The function call will not succeed. Phoenix.Controller.json( _conn :: %{ :assigns => %{:user => _, _ => _}, :body_params => %{:urls => _, _ => _}, _ => _ }, %{} ) breaks the contract (Plug.Conn.t(), term()) :: Plug.Conn.t()
This commit is contained in:
parent
861c8ebfe4
commit
8b02c85810
@ -59,12 +59,12 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
|
||||
Enum.slice(entries, offset, page_size)
|
||||
end
|
||||
|
||||
def delete(%{assigns: %{user: _}, body_params: %{urls: urls}} = conn, _) do
|
||||
def delete(%{assigns: %{user: _}, body_params: %{"urls" => urls}} = conn, _) do
|
||||
MediaProxy.remove_from_banned_urls(urls)
|
||||
json(conn, %{})
|
||||
end
|
||||
|
||||
def purge(%{assigns: %{user: _}, body_params: %{urls: urls, ban: ban}} = conn, _) do
|
||||
def purge(%{assigns: %{user: _}, body_params: %{"urls" => urls, "ban" => ban}} = conn, _) do
|
||||
MediaProxy.Invalidation.purge(urls)
|
||||
|
||||
if ban do
|
||||
|
@ -78,9 +78,9 @@ defmodule Pleroma.Web.ApiSpec.Admin.MediaProxyCacheOperation do
|
||||
"Parameters",
|
||||
%Schema{
|
||||
type: :object,
|
||||
required: [:urls],
|
||||
required: ["urls"],
|
||||
properties: %{
|
||||
urls: %Schema{type: :array, items: %Schema{type: :string, format: :uri}}
|
||||
"urls" => %Schema{type: :array, items: %Schema{type: :string, format: :uri}}
|
||||
}
|
||||
},
|
||||
required: true
|
||||
@ -104,10 +104,10 @@ defmodule Pleroma.Web.ApiSpec.Admin.MediaProxyCacheOperation do
|
||||
"Parameters",
|
||||
%Schema{
|
||||
type: :object,
|
||||
required: [:urls],
|
||||
required: ["urls"],
|
||||
properties: %{
|
||||
urls: %Schema{type: :array, items: %Schema{type: :string, format: :uri}},
|
||||
ban: %Schema{type: :boolean, default: true}
|
||||
"urls" => %Schema{type: :array, items: %Schema{type: :string, format: :uri}},
|
||||
"ban" => %Schema{type: :boolean, default: true}
|
||||
}
|
||||
},
|
||||
required: true
|
||||
|
Loading…
Reference in New Issue
Block a user