2
0
forked from Wavyzz/dolibarr

Fix return code REST similar for all api with POST

This commit is contained in:
Laurent Destailleur
2016-12-23 02:08:22 +01:00
parent 5535a126d2
commit 9e44eb0d15
20 changed files with 45 additions and 51 deletions

View File

@@ -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;