Add unschedule endpont to job controller

This commit is contained in:
Shinya Maeda 2018-09-18 16:12:13 +09:00 committed by Alessio Caiazza
parent 22e00b08e8
commit 1a6a59d6bc
2 changed files with 8 additions and 0 deletions

View File

@ -110,6 +110,13 @@ class Projects::JobsController < Projects::ApplicationController
redirect_to build_path(@build)
end
def unschedule
return respond_422 unless @build.scheduled?
@build.unschedule
redirect_to build_path(@build)
end
def status
render json: BuildSerializer
.new(project: @project, current_user: @current_user)

View File

@ -275,6 +275,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
member do
get :status
post :cancel
post :unschedule
post :retry
post :play
post :erase