*Fix API bug.
This commit is contained in:
@@ -35,7 +35,7 @@ class executionCasesEntry extends entry
|
||||
$result = array();
|
||||
foreach($cases as $case)
|
||||
{
|
||||
$case->statusName = 'name' => $this->lang->testcase->statusList[$case->status];
|
||||
$case->statusName = $this->lang->testcase->statusList[$case->status];
|
||||
$result[] = $this->format($case, 'openedDate:time,reviewedDate:date,lastEditedDate:time,lastRunDate:time');
|
||||
}
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ class taskEntry extends Entry
|
||||
$control = $this->loadController('task', 'edit');
|
||||
$control->edit($taskID);
|
||||
|
||||
$this->getData();
|
||||
if($data->status != 'success' and $data->data->result == 'fail') return $this->sendError(zget($data, 'code', 400), $data->data->message);
|
||||
$data = $this->getData();
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
$task = $this->task->getByID($taskID);
|
||||
$this->send(200, $this->format($task, 'deadline:date,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,realStarted:time,finishedBy:user,finishedDate:time,closedBy:user,closedDate:time,canceledBy:user,canceledDate:time,lastEditedBy:user,lastEditedDate:time,deleted:bool,mailto:userList'));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class taskStartEntry extends Entry
|
||||
{
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
$fields = 'assignedTo,realStarted,comment,left';
|
||||
$fields = 'assignedTo,realStarted,consumed,left,comment';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$control = $this->loadController('task', 'start');
|
||||
@@ -30,7 +30,7 @@ class taskStartEntry extends Entry
|
||||
$control->start($taskID);
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data or !isset($data->status)) return $this->send400('error');
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
|
||||
$task = $this->loadModel('task')->getByID($taskID);
|
||||
|
||||
@@ -246,6 +246,18 @@ class baseEntry
|
||||
$this->send($code, $response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send 400 response.
|
||||
*
|
||||
* @param string message
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function send400($message = 'error')
|
||||
{
|
||||
$this->sendError(400, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send 404 response.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user