Compare commits

...

1 commit

Author SHA1 Message Date
0115738a13 Set extra from raid party, not extra property 2023-11-05 11:31:38 -08:00

View file

@ -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