The return code 0 is not an error but the serveur refuse to execute the request
This commit is contained in:
parent
adb30b6acd
commit
c31a924812
@ -666,8 +666,10 @@ class Invoices extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->invoice->delete(DolibarrApiAccess::$user);
|
$result = $this->invoice->delete(DolibarrApiAccess::$user);
|
||||||
if ($result <= 0) {
|
if ($result < 0) {
|
||||||
throw new RestException(500, 'Error when deleting invoice');
|
throw new RestException(500, 'Error when deleting invoice');
|
||||||
|
} elseif ($result == 0) {
|
||||||
|
throw new RestException(403, 'Invoice not erasable');
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user