Fix seeding perf + batch role targets creation (#16337)
This commit is contained in:
@@ -126,8 +126,8 @@ export class RoleResolver {
|
||||
workspaceId: workspace.id,
|
||||
});
|
||||
|
||||
await this.userRoleService.assignRoleToUserWorkspace({
|
||||
userWorkspaceId: userWorkspace.id,
|
||||
await this.userRoleService.assignRoleToManyUserWorkspace({
|
||||
userWorkspaceIds: [userWorkspace.id],
|
||||
workspaceId: workspace.id,
|
||||
roleId,
|
||||
});
|
||||
|
||||
@@ -354,14 +354,10 @@ export class RoleService {
|
||||
workspaceId,
|
||||
);
|
||||
|
||||
await Promise.all(
|
||||
userWorkspaceIds.map((userWorkspaceId) =>
|
||||
this.userRoleService.assignRoleToUserWorkspace({
|
||||
userWorkspaceId,
|
||||
roleId: defaultRoleId,
|
||||
workspaceId,
|
||||
}),
|
||||
),
|
||||
);
|
||||
await this.userRoleService.assignRoleToManyUserWorkspace({
|
||||
userWorkspaceIds,
|
||||
roleId: defaultRoleId,
|
||||
workspaceId,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user