mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
fix #22766: better API response HTTP code
This commit is contained in:
@@ -628,7 +628,18 @@ class Users extends DolibarrApi
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$this->useraccount->oldcopy = clone $this->useraccount;
|
||||
return $this->useraccount->delete(DolibarrApiAccess::$user);
|
||||
|
||||
if (!$this->useraccount->delete(DolibarrApiAccess::$user)) {
|
||||
throw new RestException(500);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Ticket deleted'
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
|
||||
Reference in New Issue
Block a user