* Fix data of testtask api.
This commit is contained in:
@@ -20,14 +20,19 @@ class testtaskEntry extends entry
|
||||
*/
|
||||
public function get($testtaskID)
|
||||
{
|
||||
$control = $this->loadController('testtask', 'view');
|
||||
$control->view($testtaskID);
|
||||
$control = $this->loadController('testtask', 'cases');
|
||||
$control->cases($testtaskID, 'all', 0, $this->param('order', 'id_desc'), $this->param('total', 0), $this->param('limit', 20), $this->param('page', 1));
|
||||
|
||||
$data = $this->getData();
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
if(!isset($data->data->task)) $this->sendError(400, 'error');
|
||||
|
||||
$testtask = $data->data->task;
|
||||
$testtask->testcases = array();
|
||||
foreach($data->data->runs as $run)
|
||||
{
|
||||
$testtask->testcases[] = $this->format($run, 'openedBy:user,openedDate:time,reviewedBy:user,reviewedDate:date,lastEditedBy:user,lastEditedDate:time');
|
||||
}
|
||||
|
||||
$this->send(200, $this->format($testtask, 'begin:date,end:date,mailto:userList,owner:user,realFinishedDate:time'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user