Update majic & call plug before OpenApiSpex
This commit is contained in:
parent
f124f68205
commit
39f7fc5b8e
4 changed files with 8 additions and 8 deletions
|
|
@ -11,12 +11,12 @@ defmodule Pleroma.Web.MastodonAPI.MediaController do
|
|||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
|
||||
action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
|
||||
plug(Majic.Plug, [pool: Pleroma.MajicPool] when action in [:create, :create2])
|
||||
plug(Pleroma.Web.ApiSpec.CastAndValidate)
|
||||
plug(:put_view, Pleroma.Web.MastodonAPI.StatusView)
|
||||
|
||||
plug(OAuthScopesPlug, %{scopes: ["read:media"]} when action == :show)
|
||||
plug(OAuthScopesPlug, %{scopes: ["write:media"]} when action != :show)
|
||||
plug(Majic.Plug, [pool: Pleroma.MajicPool] when action in [:create, :create2])
|
||||
|
||||
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.MediaOperation
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do
|
|||
|
||||
require Pleroma.Constants
|
||||
|
||||
plug(
|
||||
Majic.Plug,
|
||||
[pool: Pleroma.MajicPool] when action in [:update_avatar, :update_background, :update_banner]
|
||||
)
|
||||
|
||||
plug(
|
||||
OpenApiSpex.Plug.PutApiSpec,
|
||||
[module: Pleroma.Web.ApiSpec] when action == :confirmation_resend
|
||||
|
|
@ -56,11 +61,6 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do
|
|||
plug(:assign_account_by_id when action in [:favourites, :subscribe, :unsubscribe])
|
||||
plug(:put_view, Pleroma.Web.MastodonAPI.AccountView)
|
||||
|
||||
plug(
|
||||
Majic.Plug,
|
||||
[pool: Pleroma.MajicPool] when action in [:update_avatar, :update_background, :update_banner]
|
||||
)
|
||||
|
||||
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaAccountOperation
|
||||
|
||||
@doc "POST /api/v1/pleroma/accounts/confirmation_resend"
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ defmodule Pleroma.Web.PleromaAPI.MascotController do
|
|||
alias Pleroma.User
|
||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||
|
||||
plug(Majic.Plug, [pool: Pleroma.MajicPool] when action in [:update])
|
||||
plug(Pleroma.Web.ApiSpec.CastAndValidate)
|
||||
plug(OAuthScopesPlug, %{scopes: ["read:accounts"]} when action == :show)
|
||||
plug(OAuthScopesPlug, %{scopes: ["write:accounts"]} when action != :show)
|
||||
plug(Majic.Plug, [pool: Pleroma.MajicPool] when action in [:update])
|
||||
|
||||
defdelegate open_api_operation(action), to: Pleroma.Web.ApiSpec.PleromaMascotOperation
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue