0
0
Fork 0

Move pagination_max_id and pagination_since_id into api/base controller (#28844)

This commit is contained in:
Matt Jankowski 2024-03-13 04:51:44 -04:00 committed by GitHub
parent 01b624c4a0
commit 9754967d5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 52 additions and 132 deletions

View file

@ -73,6 +73,14 @@ class Api::BaseController < ApplicationController
protected
def pagination_max_id
pagination_collection.last.id
end
def pagination_since_id
pagination_collection.first.id
end
def set_pagination_headers(next_path = nil, prev_path = nil)
links = []
links << [next_path, [%w(rel next)]] if next_path