fix(accounts): handle deletion failure in deleteUser method (#283)
- Added error handling for the `deleteUser` method to throw an error if the response contains an error property.
This commit is contained in:
committed by
GitHub
parent
1143a01727
commit
698e570545
@@ -46,7 +46,11 @@ class DeletePersonalAccountService {
|
||||
|
||||
// execute the deletion of the user
|
||||
try {
|
||||
await params.adminClient.auth.admin.deleteUser(userId);
|
||||
const response = await params.adminClient.auth.admin.deleteUser(userId);
|
||||
|
||||
if (response.error) {
|
||||
throw response.error;
|
||||
}
|
||||
|
||||
logger.info(ctx, 'User successfully deleted!');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user