* Modify taskbatchcreate and product type is branch -create story api.

This commit is contained in:
宋辰轩
2023-03-22 10:39:09 +08:00
parent a4b69c17bc
commit 8c5f7c510d
2 changed files with 8 additions and 5 deletions
+5 -1
View File
@@ -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);
+3 -4
View File
@@ -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));
}
}