forked from Wavyzz/dolibarr
Fix return code REST similar for all api with POST
This commit is contained in:
@@ -195,9 +195,8 @@ class Orders extends DolibarrApi
|
||||
}
|
||||
$this->commande->lines = $lines;
|
||||
}*/
|
||||
if ($this->commande->create(DolibarrApiAccess::$user) <= 0) {
|
||||
$errormsg = $this->commande->error;
|
||||
throw new RestException(500, $errormsg ? $errormsg : "Error while creating order");
|
||||
if ($this->commande->create(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500, "Error creating order", array_merge(array($this->commande->error), $this->commande->errors));
|
||||
}
|
||||
|
||||
return $this->commande->id;
|
||||
|
||||
Reference in New Issue
Block a user