mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
bug fix jobs controller
This commit is contained in:
parent
35bbd2a492
commit
2c412ce56f
1 changed files with 5 additions and 5 deletions
|
@ -16,10 +16,10 @@ class JobsController < ApplicationController
|
|||
respond_to do |format|
|
||||
if !running? && @job.destroy
|
||||
format.html { redirect_to jobs_path, notice: "Job deleted." }
|
||||
format.json { render json: "", status: :ok }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { redirect_to jobs_path, alert: 'Can not delete a running job.' }
|
||||
format.json { render json: "", status: :unprocessable_entity }
|
||||
format.json { render json: @job.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -34,7 +34,7 @@ class JobsController < ApplicationController
|
|||
format.json { render json: @job, status: :ok }
|
||||
else
|
||||
format.html { redirect_to jobs_path, alert: 'Can not enqueue a running job.' }
|
||||
format.json { render json: "", status: :unprocessable_entity }
|
||||
format.json { render json: @job.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -53,7 +53,7 @@ class JobsController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to jobs_path, notice: "Failed jobs removed." }
|
||||
format.json { render json: '', status: :ok }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -62,7 +62,7 @@ class JobsController < ApplicationController
|
|||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to jobs_path, notice: "All jobs removed." }
|
||||
format.json { render json: '', status: :ok }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue