From 0edf8d1bd4fa3a06e2775baccb39e2d640c11397 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Tue, 24 Oct 2023 16:33:42 +0200 Subject: [PATCH] baculum: Fix name parameter in jobs objects endpoint --- gui/baculum/protected/API/Pages/API/JobsObjects.php | 10 ++++++++-- gui/baculum/protected/API/openapi_baculum.json | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) 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 a6e747a20..884bb4eaa 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -2161,7 +2161,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] } } } -- 2.47.3