The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

14 lines
451 B

  1. # frozen_string_literal: true
  2. class Api::V1::PollsController < Api::BaseController
  3. before_action -> { authorize_if_got_token! :read, :'read:statuses' }, only: :show
  4. respond_to :json
  5. def show
  6. @poll = Poll.attached.find(params[:id])
  7. ActivityPub::FetchRemotePollService.new.call(@poll, current_account) if user_signed_in? && @poll.possibly_stale?
  8. render json: @poll, serializer: REST::PollSerializer, include_results: true
  9. end
  10. end