Permit detail attributes and update all attributes instead of just extra
This commit is contained in:
parent
bb736ce084
commit
ace4fb8568
1 changed files with 2 additions and 2 deletions
|
|
@ -25,7 +25,7 @@ class Api::V1::PartiesController < Api::V1::ApiController
|
||||||
if @party.user != current_user
|
if @party.user != current_user
|
||||||
render_unauthorized_response
|
render_unauthorized_response
|
||||||
else
|
else
|
||||||
@party.extra = party_params['is_extra']
|
@party.attributes = party_params
|
||||||
render :update, status: :ok if @party.save!
|
render :update, status: :ok if @party.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -71,6 +71,6 @@ class Api::V1::PartiesController < Api::V1::ApiController
|
||||||
end
|
end
|
||||||
|
|
||||||
def party_params
|
def party_params
|
||||||
params.require(:party).permit(:user_id, :is_extra)
|
params.require(:party).permit(:user_id, :is_extra, :name, :description, :raid_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Loading…
Reference in a new issue