mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-05 22:45:37 +00:00
14 lines
451 B
Ruby
14 lines
451 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class Api::V1::PollsController < Api::BaseController
|
||
|
before_action -> { authorize_if_got_token! :read, :'read:statuses' }, only: :show
|
||
|
|
||
|
respond_to :json
|
||
|
|
||
|
def show
|
||
|
@poll = Poll.attached.find(params[:id])
|
||
|
ActivityPub::FetchRemotePollService.new.call(@poll, current_account) if user_signed_in? && @poll.possibly_stale?
|
||
|
render json: @poll, serializer: REST::PollSerializer, include_results: true
|
||
|
end
|
||
|
end
|