From c82f40443b5888e6d202bd6e6e229fb2570982cb Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Fri, 24 Nov 2023 12:16:23 +0000 Subject: [PATCH] Fix teamId assignment in TeamMemberService --- CommonServer/Services/TeamMemberService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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,