return instead of erroring when suspending a suspended user

This commit is contained in:
bunnybeam 2025-07-10 16:19:55 +01:00
parent 7581b5b40b
commit d023fb3389
No known key found for this signature in database

View file

@ -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);
});
}