fedibird-fe/app/controllers/api/v1/statuses/pins_controller.rb
2022-05-11 00:48:03 +09:00

25 lines
598 B
Ruby

# frozen_string_literal: true
class Api::V1::Statuses::PinsController < Api::BaseController
include Authorization
before_action -> { doorkeeper_authorize! :write, :'write:accounts' }
before_action :require_user!
before_action :set_status
def create
PinService.new.call(current_account, @status)
render json: @status, serializer: REST::StatusSerializer
end
def destroy
UnpinService.new.call(current_account, @status)
render json: @status, serializer: REST::StatusSerializer
end
private
def set_status
@status = Status.find(params[:status_id])
end
end