Merge remote-tracking branch 'parent/main' into upstream-20240806
This commit is contained in:
commit
8e5fe5ccb9
166 changed files with 2268 additions and 1390 deletions
|
@ -5,6 +5,7 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
|||
include AccountableConcern
|
||||
|
||||
LIMIT = 100
|
||||
MAX_LIMIT = 500
|
||||
|
||||
before_action -> { authorize_if_got_token! :'admin:read', :'admin:read:domain_blocks' }, only: [:index, :show]
|
||||
before_action -> { authorize_if_got_token! :'admin:write', :'admin:write:domain_blocks' }, except: [:index, :show]
|
||||
|
@ -59,7 +60,7 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
|||
end
|
||||
|
||||
def set_domain_blocks
|
||||
@domain_blocks = DomainBlock.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
||||
@domain_blocks = DomainBlock.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT, MAX_LIMIT), params_slice(:max_id, :since_id, :min_id))
|
||||
end
|
||||
|
||||
def set_domain_block
|
||||
|
@ -84,7 +85,7 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
|||
end
|
||||
|
||||
def records_continue?
|
||||
@domain_blocks.size == limit_param(LIMIT)
|
||||
@domain_blocks.size == limit_param(LIMIT, MAX_LIMIT)
|
||||
end
|
||||
|
||||
def resource_params
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue