Skip to content

Commit

Permalink
process job posting url if a greenhouse job
Browse files Browse the repository at this point in the history
  • Loading branch information
Ches-ctrl committed May 22, 2024
1 parent 53f3d65 commit 77c72d4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/controllers/api/v0/jobs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ def valid_origin?(origin)
end

def process_job_posting(posting_url)
p "Processing job posting: #{posting_url}"
render json: { message: 'Job added successfully' }, status: :ok

# if CreateJobFromUrl.perform_later(posting_url)
# render json: { message: 'Job creation queued successfully' }, status: :ok
# else
# render json: { error: 'Failed to queue job creation' }, status: :unprocessable_entity
# end
render json: { message: 'Received but not a GH job' }, status: :ok and return unless posting_url.include?('greenhouse')

Rails.logger.info("Processing job posting: #{posting_url}")

if CreateJobFromUrl.perform_later(posting_url)
render json: { message: 'Job creation queued successfully' }, status: :ok
else
render json: { error: 'Failed to queue job creation' }, status: :unprocessable_entity
end
end
end
end
Expand Down

0 comments on commit 77c72d4

Please sign in to comment.