* Create bug api return 201, and add default value for task create assignedTo.

This commit is contained in:
songchenxuan
2023-07-06 09:25:07 +08:00
parent 50c0b2166e
commit f41e0ba923
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -92,6 +92,6 @@ class bugsEntry extends entry
$bug = $this->loadModel('bug')->getByID($data->id);
return $this->send(200, $this->format($bug, 'activatedDate:time,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,mailto:userList,resolvedBy:user,resolvedDate:time,closedBy:user,closedDate:time,lastEditedBy:user,lastEditedDate:time,deadline:date,deleted:bool'));
return $this->send(201, $this->format($bug, 'activatedDate:time,openedBy:user,openedDate:time,assignedTo:user,assignedDate:time,mailto:userList,resolvedBy:user,resolvedDate:time,closedBy:user,closedDate:time,lastEditedBy:user,lastEditedDate:time,deadline:date,deleted:bool'));
}
}
+3 -2
View File
@@ -104,8 +104,9 @@ class tasksEntry extends entry
$fields = 'name,type,assignedTo,estimate,story,execution,project,module,pri,desc,estStarted,deadline,mailto,team,teamEstimate,multiple,uid';
$this->batchSetPost($fields);
$assignedTo = $this->request('assignedTo');
if($assignedTo and !is_array($assignedTo)) $this->setPost('assignedTo', array($assignedTo));
$assignedTo = $this->request('assignedTo', array(0 => ''));
if($assignedTo and !is_array($assignedTo)) $assignedTo = array($assignedTo);
$this->setPost('assignedTo', $assignedTo);
if($this->request('multiple'))
{
if(count($this->request('team')) != count($this->request('teamEstimate'))) return $this->sendError(400, 'Arrays team and teamEstimate should be the same length');