You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
496 B
17 lines
496 B
# frozen_string_literal: true
|
|
|
|
class Api::V1::Statuses::HistoriesController < Api::V1::Statuses::BaseController
|
|
before_action -> { authorize_if_got_token! :read, :'read:statuses' }
|
|
|
|
def show
|
|
cache_if_unauthenticated!
|
|
render json: status_edits, each_serializer: REST::StatusEditSerializer
|
|
end
|
|
|
|
private
|
|
|
|
def status_edits
|
|
@status.edits.includes(:account, status: [:account]).to_a.presence || [@status.build_snapshot(at_time: @status.edited_at || @status.created_at)]
|
|
end
|
|
end
|