This commit is contained in:
syuilo 2025-02-23 14:21:52 +09:00
parent 3e139a19ce
commit 64133d7e01
1 changed files with 2 additions and 4 deletions

View File

@ -46,10 +46,8 @@ export class DeleteAccountService {
const _user = await this.usersRepository.findOneByOrFail({ id: user.id });
const systemAccounts = await this.systemAccountService.list();
for (const systemAccount of systemAccounts) {
if (systemAccount.userId === user.id) {
throw new Error('cannot delete a system account');
}
if (systemAccounts.some(x => x.id === user.id)) {
throw new Error('cannot delete a system account');
}
if (moderator != null) {