Added error handling for increasing pages
This commit is contained in:
@@ -42,6 +42,7 @@ class Operator::JobsController < ApplicationController
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @job.update(job_params)
|
||||
|
||||
broadcast_update_job
|
||||
format.html { redirect_to operator_jobs_url, notice: "Job was successfully updated." }
|
||||
else
|
||||
@@ -75,7 +76,11 @@ class Operator::JobsController < ApplicationController
|
||||
end
|
||||
|
||||
def increment_page
|
||||
@job.increment_page(params[:din])
|
||||
if @job.increment_page(params[:din])
|
||||
flash[:notice] = "Job was successfully updated"
|
||||
else
|
||||
flash[:alert] = "Job could not be updated"
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
broadcast_update_job
|
||||
@@ -90,7 +95,6 @@ class Operator::JobsController < ApplicationController
|
||||
flash[:alert] = "Job could not be updated"
|
||||
end
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
broadcast_update_job
|
||||
format.html { redirect_to operator_jobs_url }
|
||||
|
||||
Reference in New Issue
Block a user