mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-05 02:10:13 +00:00
26 lines
533 B
Ruby
26 lines
533 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Api::V1::Timelines::BaseController < Api::BaseController
|
|
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
|
|
|
private
|
|
|
|
def pagination_collection
|
|
@statuses
|
|
end
|
|
|
|
def next_path_params
|
|
permitted_params.merge(max_id: pagination_max_id)
|
|
end
|
|
|
|
def prev_path_params
|
|
permitted_params.merge(min_id: pagination_since_id)
|
|
end
|
|
|
|
def permitted_params
|
|
params
|
|
.slice(*self.class::PERMITTED_PARAMS)
|
|
.permit(*self.class::PERMITTED_PARAMS)
|
|
end
|
|
end
|