Implemented status changes operator index
This commit is contained in:
@@ -42,7 +42,6 @@ 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
|
||||
@@ -51,20 +50,6 @@ class Operator::JobsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def cancel
|
||||
if @job.canceled!
|
||||
flash[:notice] = "Job successfully canceled"
|
||||
else
|
||||
flash[:alert] = "Job could not be canceled"
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
broadcast_update_job
|
||||
format.turbo_stream
|
||||
format.html { redirect_to operator_jobs_url }
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /jobs/1 or /jobs/1.json
|
||||
def destroy
|
||||
@job.destroy!
|
||||
@@ -84,7 +69,7 @@ class Operator::JobsController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
broadcast_update_job
|
||||
format.html { redirect_to operator_jobs_url, notice: "Job was successfully updated." }
|
||||
format.html { redirect_to operator_jobs_url }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -114,6 +99,6 @@ class Operator::JobsController < ApplicationController
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def job_params
|
||||
params.require(:job).permit(:operator_id, :costumer_id, :operator_firstname, :operator_lastname, :costumer_firstname, :costumer_lastname)
|
||||
params.require(:job).permit(:operator_id, :costumer_id, :operator_firstname, :operator_lastname, :costumer_firstname, :costumer_lastname, :status)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user