mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 21:08:07 +01:00
Extract permitted params constant in v1/admin/tags (#30652)
This commit is contained in:
parent
62d070c438
commit
978601a0ae
1 changed files with 10 additions and 1 deletions
|
@ -13,6 +13,13 @@ class Api::V1::Admin::TagsController < Api::BaseController
|
||||||
|
|
||||||
LIMIT = 100
|
LIMIT = 100
|
||||||
|
|
||||||
|
PERMITTED_PARAMS = %i(
|
||||||
|
display_name
|
||||||
|
listable
|
||||||
|
trendable
|
||||||
|
usable
|
||||||
|
).freeze
|
||||||
|
|
||||||
def index
|
def index
|
||||||
authorize :tag, :index?
|
authorize :tag, :index?
|
||||||
render json: @tags, each_serializer: REST::Admin::TagSerializer
|
render json: @tags, each_serializer: REST::Admin::TagSerializer
|
||||||
|
@ -40,7 +47,9 @@ class Api::V1::Admin::TagsController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def tag_params
|
def tag_params
|
||||||
params.permit(:display_name, :trendable, :usable, :listable)
|
params
|
||||||
|
.slice(*PERMITTED_PARAMS)
|
||||||
|
.permit(*PERMITTED_PARAMS)
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_path
|
def next_path
|
||||||
|
|
Loading…
Reference in a new issue