Render the correct view when updating jobs (#186)

We were referencing an old view in `PartiesController#update_job`. This has been corrected.
This commit is contained in:
Justin Edmund 2025-02-25 09:11:13 -05:00 committed by GitHub
parent 505176ae5f
commit 9827658771
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -131,6 +131,7 @@ module Api
fields :edit_key fields :edit_key
end end
# Remixed view
view :remixed do view :remixed do
include_view :created include_view :created
include_view :source_party include_view :source_party

View file

@ -34,10 +34,10 @@ module Api
# Remove extra subskills if necessary # Remove extra subskills if necessary
if old_job && if old_job &&
%w[1 2 3].include?(old_job.row) && %w[1 2 3].include?(old_job.row) &&
%w[4 5 ex2].include?(job.row) && %w[4 5 ex2].include?(job.row) &&
@party.skill1 && @party.skill2 && @party.skill3 && @party.skill1 && @party.skill2 && @party.skill3 &&
@party.skill1.sub && @party.skill2.sub && @party.skill3.sub @party.skill1.sub && @party.skill2.sub && @party.skill3.sub
@party['skill3_id'] = nil @party['skill3_id'] = nil
end end
else else
@ -47,7 +47,7 @@ module Api
end end
end end
render json: PartyBlueprint.render(@party, view: :jobs) if @party.save! render json: PartyBlueprint.render(@party, view: :job_metadata) if @party.save!
end end
def update_job_skills def update_job_skills