2023-11-14 23:53:31 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Api::V1::Timelines::BaseController < Api::BaseController
|
|
|
|
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2024-03-13 17:51:44 +09:00
|
|
|
def pagination_collection
|
|
|
|
@statuses
|
2023-11-14 23:53:31 +09:00
|
|
|
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
|