Class: Asyncapi::Client::V1::JobsController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/asyncapi/client/v1/jobs_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
8
# File 'app/controllers/asyncapi/client/v1/jobs_controller.rb', line 5

def index
  jobs = Job.all
  paginate json: jobs
end

#updateObject



10
11
12
13
14
15
16
17
# File 'app/controllers/asyncapi/client/v1/jobs_controller.rb', line 10

def update
  if job = Job.find_by(id: params[:id], secret: params[:job][:secret])
    UpdateJob.execute(job: job, params: job_params)
    render json: job
  else
    render nothing: true, status: 403
  end
end