Pleroma.Web.AdminAPI.MediaProxyCacheController: fix dialyzer errors with replace_params: false
This commit is contained in:
parent
ea26dcd800
commit
fb6f53fc12
@ -11,7 +11,7 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
|
|||||||
|
|
||||||
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
|
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
|
||||||
|
|
||||||
plug(Pleroma.Web.ApiSpec.CastAndValidate)
|
plug(Pleroma.Web.ApiSpec.CastAndValidate, replace_params: false)
|
||||||
|
|
||||||
plug(
|
plug(
|
||||||
OAuthScopesPlug,
|
OAuthScopesPlug,
|
||||||
@ -27,7 +27,7 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
|
|||||||
|
|
||||||
defdelegate open_api_operation(action), to: Spec.MediaProxyCacheOperation
|
defdelegate open_api_operation(action), to: Spec.MediaProxyCacheOperation
|
||||||
|
|
||||||
def index(%{assigns: %{user: _}} = conn, params) do
|
def index(%{assigns: %{user: _}, private: %{open_api_spex: %{params: params}}} = conn, _) do
|
||||||
entries = fetch_entries(params)
|
entries = fetch_entries(params)
|
||||||
urls = paginate_entries(entries, params.page, params.page_size)
|
urls = paginate_entries(entries, params.page, params.page_size)
|
||||||
|
|
||||||
@ -59,12 +59,19 @@ defmodule Pleroma.Web.AdminAPI.MediaProxyCacheController do
|
|||||||
Enum.slice(entries, offset, page_size)
|
Enum.slice(entries, offset, page_size)
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete(%{assigns: %{user: _}, body_params: %{urls: urls}} = conn, _) do
|
def delete(
|
||||||
|
%{assigns: %{user: _}, private: %{open_api_spex: %{body_params: %{urls: urls}}}} = conn,
|
||||||
|
_
|
||||||
|
) do
|
||||||
MediaProxy.remove_from_banned_urls(urls)
|
MediaProxy.remove_from_banned_urls(urls)
|
||||||
json(conn, %{})
|
json(conn, %{})
|
||||||
end
|
end
|
||||||
|
|
||||||
def purge(%{assigns: %{user: _}, body_params: %{urls: urls, ban: ban}} = conn, _) do
|
def purge(
|
||||||
|
%{assigns: %{user: _}, private: %{open_api_spex: %{body_params: %{urls: urls, ban: ban}}}} =
|
||||||
|
conn,
|
||||||
|
_
|
||||||
|
) do
|
||||||
MediaProxy.Invalidation.purge(urls)
|
MediaProxy.Invalidation.purge(urls)
|
||||||
|
|
||||||
if ban do
|
if ban do
|
||||||
|
Loading…
Reference in New Issue
Block a user