mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-09 08:25:55 +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
|