Commit 1372ab96 authored by Marcin Haba's avatar Marcin Haba
Browse files

baculum: Fix using multiple job statuses in list jobs jobstatus filter

parent 1bbdf9ca
......@@ -121,17 +121,17 @@ class Jobs extends BaculumAPIServer {
$jobstatuses = array_keys($misc->getJobState());
$sts = str_split($jobstatus);
$counter = 0;
$js_counter = 0;
for ($i = 0; $i < count($sts); $i++) {
if (in_array($sts[$i], $jobstatuses)) {
if (!key_exists('Job.JobStatus', $params)) {
$params['Job.JobStatus'][$counter] = [
$params['Job.JobStatus'] = [];
$params['Job.JobStatus'][$js_counter] = [
'operator' => 'OR',
'vals' => []
];
}
$params['Job.JobStatus'][$counter]['vals'][] = $sts[$i];
$counter++;
$params['Job.JobStatus'][$js_counter]['vals'][] = $sts[$i];
}
}
if (!empty($level)) {
......
......@@ -876,7 +876,7 @@
"name": "jobstatus",
"in": "query",
"required": false,
"description": "Job status letter",
"description": "Job status letter(s). Possible multiple values like 'Ef' or 'Tef'",
"schema": {
"type": "string"
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment