Merge pull request #898 from shocknet/activate-users-cleanup
cleanup fix
This commit is contained in:
commit
8576a1d138
1 changed files with 4 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import crypto from 'crypto';
|
||||
import { Between, FindOperator, IsNull, LessThanOrEqual, MoreThanOrEqual, In } from "typeorm"
|
||||
import { Between, FindOperator, IsNull, LessThanOrEqual, MoreThanOrEqual } from "typeorm"
|
||||
import { generateSecretKey, getPublicKey } from 'nostr-tools';
|
||||
import { Application } from "./entity/Application.js"
|
||||
import UserStorage from './userStorage.js';
|
||||
|
|
@ -162,9 +162,9 @@ export default class {
|
|||
}
|
||||
|
||||
async RemoveAppUsersAndBaseUsers(appUserIds: string[], baseUser: string, txId?: string) {
|
||||
if (appUserIds.length > 0) {
|
||||
const appUsers = await this.dbs.Find<ApplicationUser>('ApplicationUser', { where: { identifier: In(appUserIds) } }, txId)
|
||||
for (const appUser of appUsers) {
|
||||
for (const appUserId of appUserIds) {
|
||||
const appUser = await this.dbs.FindOne<ApplicationUser>('ApplicationUser', { where: { identifier: appUserId } }, txId)
|
||||
if (appUser) {
|
||||
await this.dbs.Delete<ApplicationUser>('ApplicationUser', appUser.serial_id, txId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue