From: Marcin Haba Date: Tue, 24 Oct 2023 14:33:42 +0000 (+0200) Subject: baculum: Fix name parameter in jobs objects endpoint X-Git-Tag: Beta-15.0.1~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40f4ab63a7f994803b18bd2b4883e7772e611832;p=thirdparty%2Fbacula.git baculum: Fix name parameter in jobs objects endpoint --- diff --git a/gui/baculum/protected/API/Pages/API/JobsObjects.php b/gui/baculum/protected/API/Pages/API/JobsObjects.php index de42ad52e..a509fd3d2 100644 --- a/gui/baculum/protected/API/Pages/API/JobsObjects.php +++ b/gui/baculum/protected/API/Pages/API/JobsObjects.php @@ -409,8 +409,14 @@ class JobsObjects extends BaculumAPIServer { ); if ($result->exitcode === 0) { $vals = []; - if (!empty($jobname) && in_array($jobname, $result->output)) { - $vals = [$jobname]; + if (!empty($jobname)) { + if (in_array($jobname, $result->output)) { + $vals = [$jobname]; + } else { + $this->output = JobError::MSG_ERROR_JOB_DOES_NOT_EXISTS; + $this->error = JobError::ERROR_JOB_DOES_NOT_EXISTS; + return; + } } else { $vals = $result->output; } diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index 31e636731..9cf84a098 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -2170,7 +2170,7 @@ "error": { "type": "integer", "description": "Error code", - "enum": [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 1000] + "enum": [0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 50, 1000] } } }