|
@ -36,13 +36,17 @@ class Api::V1::Trends::LinksController < Api::BaseController |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def next_path |
|
|
def next_path |
|
|
api_v1_trends_links_url pagination_params(offset: offset_param + limit_param(DEFAULT_LINKS_LIMIT)) |
|
|
|
|
|
|
|
|
api_v1_trends_links_url pagination_params(offset: offset_param + limit_param(DEFAULT_LINKS_LIMIT)) if records_continue? |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
def prev_path |
|
|
def prev_path |
|
|
api_v1_trends_links_url pagination_params(offset: offset_param - limit_param(DEFAULT_LINKS_LIMIT)) if offset_param > limit_param(DEFAULT_LINKS_LIMIT) |
|
|
api_v1_trends_links_url pagination_params(offset: offset_param - limit_param(DEFAULT_LINKS_LIMIT)) if offset_param > limit_param(DEFAULT_LINKS_LIMIT) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def records_continue? |
|
|
|
|
|
@links.size == limit_param(DEFAULT_LINKS_LIMIT) |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
def offset_param |
|
|
def offset_param |
|
|
params[:offset].to_i |
|
|
params[:offset].to_i |
|
|
end |
|
|
end |
|
|