Use polymorphic table for space membership

This commit is contained in:
Philipinho
2024-03-22 00:40:13 +00:00
parent 639842182c
commit 51baf30f0d
25 changed files with 471 additions and 452 deletions

View File

@ -89,12 +89,6 @@ export class GroupUserService {
throw new NotFoundException('Group not found');
}
const find = await manager.findOne(User, {
where: { id: userId },
});
console.log(find);
const userExists = await manager.exists(User, {
where: { id: userId, workspaceId },
});

View File

@ -119,7 +119,7 @@ export class GroupService {
.where('group.id = :groupId', { groupId })
.andWhere('group.workspaceId = :workspaceId', { workspaceId })
.loadRelationCountAndMap(
'group.userCount',
'group.memberCount',
'group.groupUsers',
'groupUsers',
)
@ -140,7 +140,7 @@ export class GroupService {
.createQueryBuilder('group')
.where('group.workspaceId = :workspaceId', { workspaceId })
.loadRelationCountAndMap(
'group.userCount',
'group.memberCount',
'group.groupUsers',
'groupUsers',
)