0
0
Fork 0

Move pagination_params into API::BaseController (#28845)

This commit is contained in:
Matt Jankowski 2024-05-30 10:56:48 -04:00 committed by GitHub
parent a0b525e50b
commit 85d9053b36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 9 additions and 125 deletions

View file

@ -14,8 +14,6 @@ class Api::V1::Admin::DomainAllowsController < Api::BaseController
after_action :verify_authorized
after_action :insert_pagination_headers, only: :index
PAGINATION_PARAMS = %i(limit).freeze
def index
authorize :domain_allow, :index?
render json: @domain_allows, each_serializer: REST::Admin::DomainAllowSerializer
@ -77,10 +75,6 @@ class Api::V1::Admin::DomainAllowsController < Api::BaseController
@domain_allows.size == limit_param(LIMIT)
end
def pagination_params(core_params)
params.slice(*PAGINATION_PARAMS).permit(*PAGINATION_PARAMS).merge(core_params)
end
def resource_params
params.permit(:domain)
end