Show command type of the command is non-string.

This commit is contained in:
abdulmohsen
2024-03-05 16:22:30 +03:00
parent 165bcef1ed
commit 93a3b6e0c0
2 changed files with 5 additions and 6 deletions

View File

@@ -53,6 +53,10 @@ final class Index
'args' => ag($task, 'args'),
];
if (!is_string($item['command'])) {
$item['command'] = get_debug_type($item['command']);
}
if ($isEnabled) {
$item['next_run'] = makeDate(ag($task, 'timer')->getNextRunDate());
$item['prev_run'] = makeDate(ag($task, 'timer')->getPreviousRunDate());

View File

@@ -25,11 +25,6 @@ final class View
return api_error('Task not found.', HTTP_STATUS::HTTP_NOT_FOUND);
}
$response = [
'@self' => parseConfigValue(Index::URL . '/' . $id),
...Index::formatTask($task)
];
return api_response($response, HTTP_STATUS::HTTP_OK);
return api_response(Index::formatTask($task), HTTP_STATUS::HTTP_OK);
}
}