Move pagination_params into API::BaseController (#28845)
		
	This commit is contained in:
		
					parent
					
						
							
								a0b525e50b
							
						
					
				
			
			
				commit
				
					
						85d9053b36
					
				
			
		
					 28 changed files with 9 additions and 125 deletions
				
			
		|  | @ -14,8 +14,6 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController | |||
|   after_action :verify_authorized | ||||
|   after_action :insert_pagination_headers, only: :index | ||||
| 
 | ||||
|   PAGINATION_PARAMS = %i(limit).freeze | ||||
| 
 | ||||
|   def index | ||||
|     authorize :domain_block, :index? | ||||
|     render json: @domain_blocks, each_serializer: REST::Admin::DomainBlockSerializer | ||||
|  | @ -93,10 +91,6 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController | |||
|     @domain_blocks.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, :severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate) | ||||
|   end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue