Fix ActionController::Parameters in API issue
This commit is contained in:
parent
f722bd2387
commit
4c53af64f0
6 changed files with 39 additions and 13 deletions
|
@ -7,7 +7,7 @@ class Api::V1::FollowsController < ApiController
|
|||
respond_to :json
|
||||
|
||||
def create
|
||||
raise ActiveRecord::RecordNotFound if params[:uri].blank?
|
||||
raise ActiveRecord::RecordNotFound if follow_params[:uri].blank?
|
||||
|
||||
@account = FollowService.new.call(current_user.account, target_uri).try(:target_account)
|
||||
render action: :show
|
||||
|
@ -16,6 +16,10 @@ class Api::V1::FollowsController < ApiController
|
|||
private
|
||||
|
||||
def target_uri
|
||||
params[:uri].strip.gsub(/\A@/, '')
|
||||
follow_params[:uri].strip.gsub(/\A@/, '')
|
||||
end
|
||||
|
||||
def follow_params
|
||||
params.permit(:uri)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue