Class: Api::V1::JobsController

Inherits:
ApiController
  • Object
show all
Defined in:
app/controllers/integration_pal/api/v1/jobs_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /jobs



12
13
14
15
16
17
18
19
20
# File 'app/controllers/integration_pal/api/v1/jobs_controller.rb', line 12

def create
  @job = Job.new(job_params)
  if @job.save
    @job.queue_job
    render json: @job, status: :ok
  else
    render json: {errors: @job.errors}, status: :unprocessable_entity
  end
end

#showObject

GET /jobs/1



6
7
8
9
# File 'app/controllers/integration_pal/api/v1/jobs_controller.rb', line 6

def show
  @job = Job.find(params[:id])
  render json: @job, status: :ok
end