FIX deleteContact
This commit is contained in:
parent
fbc8fe1e0c
commit
90d2dfcca7
@ -502,10 +502,19 @@ class Invoices extends DolibarrApi
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$result = $this->invoice->delete_contact($rowid);
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when deleted the contact');
|
||||
}
|
||||
$contacts = $this->invoice->liste_contact();
|
||||
|
||||
foreach ($contacts as $contact) {
|
||||
if ($contact['id'] == $rowid) {
|
||||
$result = $this->invoice->delete_contact($contact['rowid']);
|
||||
|
||||
if (!$result) {
|
||||
throw new RestException(500, 'Error when deleted the contact');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_cleanObjectDatas($this->invoice);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user