2
0
forked from Wavyzz/dolibarr

New API methods

add user to group
get product list by category id
This commit is contained in:
nka11
2016-04-27 08:59:12 +02:00
parent 56d25a7c2b
commit 98f757a87a
4 changed files with 120 additions and 7 deletions

View File

@@ -207,9 +207,9 @@ class CommandeApi extends DolibarrApi
*/
function post($request_data = NULL)
{
if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401);
}
if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
$result = $this->_validate($request_data);
@@ -224,7 +224,7 @@ class CommandeApi extends DolibarrApi
$this->commande->lines = $lines;
}
if(! $this->commande->create(DolibarrApiAccess::$user) ) {
throw new RestException(401);
throw new RestException(500, "Error while creating order");
}
return $this->commande->id;