NEW Return the order object when validate
Return the order object when the order is validated using the REST API
This commit is contained in:
parent
4e9dae5129
commit
73fe991aed
@ -492,13 +492,17 @@ class Orders extends DolibarrApi
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(500, 'Error when validating Order: '.$this->commande->error);
|
throw new RestException(500, 'Error when validating Order: '.$this->commande->error);
|
||||||
}
|
}
|
||||||
|
$result = $this->commande->fetch($id);
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Order not found');
|
||||||
|
}
|
||||||
|
|
||||||
return array(
|
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
|
||||||
'success' => array(
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
'code' => 200,
|
}
|
||||||
'message' => 'Order validated (Ref='.$this->commande->ref.')'
|
|
||||||
)
|
$this->commande->fetchObjectLinked();
|
||||||
);
|
return $this->_cleanObjectDatas($this->commande);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user