* Return id when create object by API.
This commit is contained in:
@@ -57,8 +57,9 @@ class group extends control
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->group->create();
|
||||
$groupID = $this->group->create();
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $groupID));
|
||||
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
|
||||
die(js::locate($this->createLink('group', 'browse'), 'parent'));
|
||||
}
|
||||
|
||||
@@ -61,8 +61,9 @@ class jenkins extends control
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->jenkins->create();
|
||||
$jenkinsID = $this->jenkins->create();
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if($this->viewType == 'json') $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $jenkinsID));
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
}
|
||||
|
||||
@@ -116,8 +117,8 @@ class jenkins extends control
|
||||
|
||||
/**
|
||||
* Ajax get tasks.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@@ -60,8 +60,8 @@ class jenkinsModel extends model
|
||||
|
||||
/**
|
||||
* Get jenkins tasks.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @param int $id
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -107,7 +107,8 @@ class jenkinsModel extends model
|
||||
->batchCheck("url", 'URL')
|
||||
->autoCheck()
|
||||
->exec();
|
||||
return !dao::isError();
|
||||
if(dao::isError()) return false;
|
||||
return $this->dao->lastInsertId();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user