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.

19 lines
432 B

  1. class Api::V1::FollowsController < ApiController
  2. before_action -> { doorkeeper_authorize! :follow }
  3. before_action :require_user!
  4. respond_to :json
  5. def create
  6. raise ActiveRecord::RecordNotFound if params[:uri].blank?
  7. @account = FollowService.new.call(current_user.account, target_uri).try(:target_account)
  8. render action: :show
  9. end
  10. private
  11. def target_uri
  12. params[:uri].strip.gsub(/\A@/, '')
  13. end
  14. end