Resolve `TODO` in `api/v1/admin/domain_*` controllers (#31067)
parent
65a8dc7869
commit
0397df9bef
|
@ -47,18 +47,13 @@ class Api::V1::Admin::DomainAllowsController < Api::BaseController
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_domain_allows
|
def set_domain_allows
|
||||||
@domain_allows = filtered_domain_allows.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
@domain_allows = DomainAllow.order(id: :desc).to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_domain_allow
|
def set_domain_allow
|
||||||
@domain_allow = DomainAllow.find(params[:id])
|
@domain_allow = DomainAllow.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def filtered_domain_allows
|
|
||||||
# TODO: no filtering yet
|
|
||||||
DomainAllow.all
|
|
||||||
end
|
|
||||||
|
|
||||||
def next_path
|
def next_path
|
||||||
api_v1_admin_domain_allows_url(pagination_params(max_id: pagination_max_id)) if records_continue?
|
api_v1_admin_domain_allows_url(pagination_params(max_id: pagination_max_id)) if records_continue?
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,18 +59,13 @@ class Api::V1::Admin::DomainBlocksController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_domain_blocks
|
def set_domain_blocks
|
||||||
@domain_blocks = filtered_domain_blocks.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), params_slice(:max_id, :since_id, :min_id))
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_domain_block
|
def set_domain_block
|
||||||
@domain_block = DomainBlock.find(params[:id])
|
@domain_block = DomainBlock.find(params[:id])
|
||||||
end
|
end
|
||||||
|
|
||||||
def filtered_domain_blocks
|
|
||||||
# TODO: no filtering yet
|
|
||||||
DomainBlock.all
|
|
||||||
end
|
|
||||||
|
|
||||||
def domain_block_params
|
def domain_block_params
|
||||||
params.permit(:severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate)
|
params.permit(:severity, :reject_media, :reject_reports, :private_comment, :public_comment, :obfuscate)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue