From a2446bfef2a0acbd18ce5c8572f9feebc3042d9e Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 20 Dec 2023 16:26:12 +0900 Subject: [PATCH] Update UserListService.ts --- packages/backend/src/core/UserListService.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/backend/src/core/UserListService.ts b/packages/backend/src/core/UserListService.ts index 702c731fc3..66c66ad466 100644 --- a/packages/backend/src/core/UserListService.ts +++ b/packages/backend/src/core/UserListService.ts @@ -15,7 +15,6 @@ import { DI } from '@/di-symbols.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { ProxyAccountService } from '@/core/ProxyAccountService.js'; import { bindThis } from '@/decorators.js'; -import { RoleService } from '@/core/RoleService.js'; import { QueueService } from '@/core/QueueService.js'; import { RedisKVCache } from '@/misc/cache.js'; import type { GlobalEvents } from '@/core/GlobalEventService.js'; @@ -38,7 +37,7 @@ export class UserListService implements OnApplicationShutdown { private userEntityService: UserEntityService, private idService: IdService, - private roleService: RoleService, + //private roleService: RoleService, private globalEventService: GlobalEventService, private proxyAccountService: ProxyAccountService, private queueService: QueueService, @@ -85,12 +84,13 @@ export class UserListService implements OnApplicationShutdown { @bindThis public async addMember(target: MiUser, list: MiUserList, me: MiUser) { - const currentCount = await this.userListMembershipsRepository.countBy({ - userListId: list.id, - }); - if (currentCount > (await this.roleService.getUserPolicies(me.id)).userEachUserListsLimit) { - throw new UserListService.TooManyUsersError(); - } + // 循環参照するからRoleServiceを使えない + //const currentCount = await this.userListMembershipsRepository.countBy({ + // userListId: list.id, + //}); + //if (currentCount > (await this.roleService.getUserPolicies(me.id)).userEachUserListsLimit) { + // throw new UserListService.TooManyUsersError(); + //} await this.userListMembershipsRepository.insert({ id: this.idService.gen(),