Move pagination_max_id
and pagination_since_id
into api/base controller (#28844)
This commit is contained in:
parent
01b624c4a0
commit
9754967d5f
23 changed files with 52 additions and 132 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue