* Modify taskbatchcreate and product type is branch -create story api.
This commit is contained in:
@@ -68,9 +68,13 @@ class storiesEntry extends entry
|
||||
if(!$productID and isset($this->requestBody->product)) $productID = $this->requestBody->product;
|
||||
if(!$productID) return $this->sendError(400, 'Need product id.');
|
||||
|
||||
$fields = 'title,spec,verify,reviewer,type,parent,plan,module,moduleOptionMenu,source,sourceNote,category,pri,estimate,mailto,keywords,notifyemail,uid,URS,status';
|
||||
$fields = 'title,spec,verify,reviewer,type,parent,moduleOptionMenu,source,sourceNote,category,pri,estimate,mailto,keywords,notifyemail,uid,URS,status';
|
||||
$this->batchSetPost($fields);
|
||||
|
||||
$this->setPost('plans', array($this->request('plan')));
|
||||
$this->setPost('branches', array($this->request('branch')));
|
||||
$this->setPost('modules', array($this->request('module')));
|
||||
|
||||
/* If reviewer is not post, set needNotReview. */
|
||||
$reviewer = $this->request('reviewer');
|
||||
if(empty($reviewer)) $this->setPost('needNotReview', 1);
|
||||
|
||||
@@ -77,10 +77,9 @@ class taskBatchCreateEntry extends entry
|
||||
|
||||
$data = $this->getData();
|
||||
if(!$data) return $this->send400('error');
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
|
||||
if(isset($data->data->result) and $data->data->result == 'fail') return $this->sendError(400, $data->data->message);
|
||||
|
||||
if(!$taskID) return $this->send(200, array());
|
||||
$task = $this->loadModel('task')->getById($taskID);
|
||||
return $this->send(200, array('task' => $task));
|
||||
$tasks = $this->loadModel('task')->getByList($data->idList);
|
||||
return $this->send(200, array('task' => $tasks));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user