return instead of erroring when suspending a suspended user
This commit is contained in:
parent
7581b5b40b
commit
d023fb3389
1 changed files with 2 additions and 1 deletions
|
|
@ -43,12 +43,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
|
||||
if (user.isSuspended) {
|
||||
throw new Error('user already suspended');
|
||||
return;
|
||||
}
|
||||
|
||||
if (await this.roleService.isModerator(user)) {
|
||||
throw new Error('cannot suspend moderator account');
|
||||
}
|
||||
|
||||
await this.userSuspendService.suspend(user, me);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue