Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 15.0

This commit is contained in:
Laurent Destailleur
2022-12-01 17:42:02 +01:00
8 changed files with 66 additions and 15 deletions

View File

@@ -640,7 +640,17 @@ 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