Set extra from raid party, not extra property (#137)
This commit is contained in:
parent
3356701671
commit
92f29dfa08
1 changed files with 10 additions and 0 deletions
|
|
@ -23,6 +23,11 @@ module Api
|
||||||
party.user = current_user if current_user
|
party.user = current_user if current_user
|
||||||
party.attributes = party_params if party_params
|
party.attributes = party_params if party_params
|
||||||
|
|
||||||
|
if party_params && party_params[:raid_id]
|
||||||
|
raid = Raid.find_by(id: party_params[:raid_id])
|
||||||
|
party.extra = raid.group.extra
|
||||||
|
end
|
||||||
|
|
||||||
if party.save!
|
if party.save!
|
||||||
return render json: PartyBlueprint.render(party, view: :created, root: :party),
|
return render json: PartyBlueprint.render(party, view: :created, root: :party),
|
||||||
status: :created
|
status: :created
|
||||||
|
|
@ -45,6 +50,11 @@ module Api
|
||||||
def update
|
def update
|
||||||
@party.attributes = party_params.except(:skill1_id, :skill2_id, :skill3_id)
|
@party.attributes = party_params.except(:skill1_id, :skill2_id, :skill3_id)
|
||||||
|
|
||||||
|
if party_params && party_params[:raid_id]
|
||||||
|
raid = Raid.find_by(id: party_params[:raid_id])
|
||||||
|
@party.extra = raid.group.extra
|
||||||
|
end
|
||||||
|
|
||||||
# TODO: Validate accessory with job
|
# TODO: Validate accessory with job
|
||||||
|
|
||||||
return render json: PartyBlueprint.render(@party, view: :full, root: :party) if @party.save
|
return render json: PartyBlueprint.render(@party, view: :full, root: :party) if @party.save
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue