Manage SystemManagers

This commit is contained in:
Bastian Wagner
2025-01-02 13:16:45 +01:00
parent bf64103369
commit efbfc2eb01
18 changed files with 266 additions and 23 deletions

View File

@@ -61,4 +61,16 @@ export class UserRepository extends Repository<User> {
const sso = await this.ssoRepo.findByExternalId(externalId);
return user == null && sso == null;
}
async deleteUserById(id: string) {
const user = await this.findOne({
where: { id },
relations: ['external']
});
if (user.external) {
await this.ssoRepo.remove(user.external);
}
return this.softRemove(user)
}
}