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);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->invoice->delete_contact($rowid);
|
$contacts = $this->invoice->liste_contact();
|
||||||
if ($result < 0) {
|
|
||||||
throw new RestException(500, 'Error when deleted the 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);
|
return $this->_cleanObjectDatas($this->invoice);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user