@@ -189,16 +189,16 @@ export class UserService {
189
189
await this . userRepo . update ( user . id , { recycle : updateUserInput . recycle } ) ;
190
190
}
191
191
if ( updateUserInput . roleIds && updateUserInput . roleIds . length ) {
192
- updateUserInput . roleIds . forEach ( async roleId => {
192
+ for ( const roleId of updateUserInput . roleIds ) {
193
193
await this . userRepo . createQueryBuilder ( 'user' ) . relation ( User , 'roles' ) . of ( user ) . remove ( roleId . before ) ;
194
194
await this . userRepo . createQueryBuilder ( 'user' ) . relation ( User , 'roles' ) . of ( user ) . add ( roleId . after ) ;
195
- } ) ;
195
+ }
196
196
}
197
197
if ( updateUserInput . organizationIds && updateUserInput . organizationIds . length ) {
198
- updateUserInput . organizationIds . forEach ( async organizationId => {
198
+ for ( const organizationId of updateUserInput . organizationIds ) {
199
199
await this . userRepo . createQueryBuilder ( 'user' ) . relation ( User , 'organizations' ) . of ( user ) . remove ( organizationId . before ) ;
200
200
await this . userRepo . createQueryBuilder ( 'user' ) . relation ( User , 'organizations' ) . of ( user ) . add ( organizationId . after ) ;
201
- } ) ;
201
+ }
202
202
}
203
203
if ( updateUserInput . infoKVs && updateUserInput . infoKVs . length ) {
204
204
await this . createOrUpdateUserInfos ( user , updateUserInput . infoKVs , 'update' ) ;
@@ -445,21 +445,21 @@ export class UserService {
445
445
private async createOrUpdateUserInfos ( user : User , infoKVs : CreateUserInfoKVs [ ] | UpdateUserInfoKVs [ ] , action : 'create' | 'update' ) {
446
446
if ( infoKVs . length ) {
447
447
if ( action === 'create' ) {
448
- ( infoKVs as CreateUserInfoKVs [ ] ) . forEach ( async infoKV => {
448
+ for ( const infoKV of ( infoKVs as CreateUserInfoKVs [ ] ) ) {
449
449
const userInfo = this . userInfoRepo . create ( { value : infoKV . userInfoValue , user, infoItem : { id : infoKV . infoItemId } } ) ;
450
450
await this . userInfoRepo . save ( userInfo ) ;
451
- } ) ;
451
+ }
452
452
return ;
453
453
}
454
454
455
- ( infoKVs as UpdateUserInfoKVs [ ] ) . forEach ( async infoKV => {
455
+ for ( const infoKV of ( infoKVs as UpdateUserInfoKVs [ ] ) ) {
456
456
if ( infoKV . userInfoId ) {
457
457
await this . userInfoRepo . update ( infoKV . userInfoId , { value : infoKV . userInfoValue } ) ;
458
458
} else {
459
459
const userInfo = this . userInfoRepo . create ( { value : infoKV . userInfoValue , user, infoItem : { id : infoKV . infoItemId } } ) ;
460
460
await this . userInfoRepo . save ( userInfo ) ;
461
461
}
462
- } ) ;
462
+ }
463
463
}
464
464
}
465
465
0 commit comments