Added broadcast feature to operator_jobs when job is canceled
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
class Operator::JobsController < ApplicationController
|
||||
before_action :set_job, only: %i[show edit update destroy cancel increment_page decrement_page]
|
||||
before_action :set_job, only: %i[show edit update destroy increment_page decrement_page]
|
||||
|
||||
# GET /jobs or /jobs.json
|
||||
def index
|
||||
# FIXME: Move to the model (orderstuff)
|
||||
@openjobs = Job.open.order(:created_at)
|
||||
@printingjobs = Job.printing.order(:status_changed_at)
|
||||
@pickupjobs = Job.pickup.order(:status_changed_at)
|
||||
@@ -43,6 +44,7 @@ class Operator::JobsController < ApplicationController
|
||||
respond_to do |format|
|
||||
if @job.update(job_params)
|
||||
broadcast_update_job
|
||||
# format.turbo_stream
|
||||
format.html { redirect_to operator_jobs_url, notice: "Job was successfully updated." }
|
||||
else
|
||||
format.html { render :edit, status: :unprocessable_entity }
|
||||
@@ -69,6 +71,7 @@ class Operator::JobsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
broadcast_update_job
|
||||
# format.turbo_stream
|
||||
format.html { redirect_to operator_jobs_url }
|
||||
end
|
||||
end
|
||||
@@ -82,6 +85,7 @@ class Operator::JobsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
broadcast_update_job
|
||||
# format.turbo_stream
|
||||
format.html { redirect_to operator_jobs_url }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user