1
0
Fork 0
forked from gitea/nas

Merge remote-tracking branch 'parent/main' into upstream-20240604

This commit is contained in:
KMY 2024-06-04 08:02:05 +09:00
commit 8927b1444b
89 changed files with 1132 additions and 458 deletions

View file

@ -3,6 +3,8 @@
module Api::Pagination
extend ActiveSupport::Concern
PAGINATION_PARAMS = %i(limit).freeze
protected
def pagination_max_id
@ -24,6 +26,13 @@ module Api::Pagination
render json: { error: 'Pagination values for `offset` and `limit` must be positive' }, status: 400 if pagination_options_invalid?
end
def pagination_params(core_params)
params
.slice(*PAGINATION_PARAMS)
.permit(*PAGINATION_PARAMS)
.merge(core_params)
end
private
def insert_pagination_headers