From f736b7ff683fe8e8060c81142cdf1fe4917172a3 Mon Sep 17 00:00:00 2001 From: Pay Giesselmann Date: Thu, 24 Nov 2022 14:28:57 +0100 Subject: [PATCH] preserve job state in StopJob --- internal/api/rest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }