diff --git a/CommonServer/Services/TeamMemberService.ts b/CommonServer/Services/TeamMemberService.ts index e51fc75a62..2f73521865 100644 --- a/CommonServer/Services/TeamMemberService.ts +++ b/CommonServer/Services/TeamMemberService.ts @@ -143,7 +143,9 @@ export class TeamMemberService extends DatabaseService { const member: TeamMember | null = await this.findOneBy({ query: { userId: createBy.data.userId!, - teamId: new ObjectID(createBy.data.team!._id!), + teamId: + createBy.data.teamId || + new ObjectID(createBy.data.team!._id!), }, props: { isRoot: true,