TEMP: Comment out problematic code
We don't ever send parameters when posting a party, so for now we don't need to worry about this. We can't leave this like this though: You should be able to send a complete party in the future (for API creation via strings)
This commit is contained in:
parent
d13230bdb7
commit
beeeef3104
1 changed files with 16 additions and 14 deletions
|
|
@ -8,22 +8,24 @@ module Api
|
|||
before_action :set, only: %w[update destroy]
|
||||
|
||||
def create
|
||||
@party = Party.new(shortcode: random_string)
|
||||
@party.extra = party_params['extra']
|
||||
party = Party.new(shortcode: random_string)
|
||||
party.user = current_user if current_user
|
||||
|
||||
# TODO: Extract this into a different method
|
||||
job = Job.find(party_params['job_id']) if party_params['job_id'].present?
|
||||
if job
|
||||
job_skills = JobSkill.where(job: job.id, main: true)
|
||||
job_skills.each_with_index do |skill, index|
|
||||
@party["skill#{index}_id"] = skill.id
|
||||
end
|
||||
end
|
||||
# unless party_params.empty?
|
||||
# party.attributes = party_params
|
||||
#
|
||||
# # TODO: Extract this into a different method
|
||||
# job = Job.find(party_params['job_id']) if party_params['job_id'].present?
|
||||
# if job
|
||||
# job_skills = JobSkill.where(job: job.id, main: true)
|
||||
# job_skills.each_with_index do |skill, index|
|
||||
# party["skill#{index}_id"] = skill.id
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
@party.user = current_user if current_user
|
||||
|
||||
if @party.save!
|
||||
return render json: PartyBlueprint.render(@party, view: :full, root: :party),
|
||||
if party.save!
|
||||
return render json: PartyBlueprint.render(party, view: :full, root: :party),
|
||||
status: :created
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue