diff --git a/internal/api/rest.go b/internal/api/rest.go index fd62d75..d37e871 100644 --- a/internal/api/rest.go +++ b/internal/api/rest.go @@ -517,7 +517,7 @@ func (api *RestApi) checkAndHandleStopJob(rw http.ResponseWriter, job *schema.Jo if req.State != "" && !req.State.Valid() { handleError(fmt.Errorf("invalid job state: %#v", req.State), http.StatusBadRequest, rw) return - } else { + } else if req.State == "" { req.State = schema.JobStateCompleted }