diff --git a/bin/auth-api/src/services/workspaces.service.ts b/bin/auth-api/src/services/workspaces.service.ts index 7a94489ee5..7f8627d42c 100644 --- a/bin/auth-api/src/services/workspaces.service.ts +++ b/bin/auth-api/src/services/workspaces.service.ts @@ -190,15 +190,15 @@ export async function inviteMember( memberAddedAt: new Date(), invitedBy: authUser.email, }); + } else { + tracker.trackEvent(authUser, "workspace_existing_user_invited", { + workspaceId: id, + memberAdded: email, + memberAddedAt: new Date(), + invitedBy: authUser.email, + }); } - tracker.trackEvent(authUser, "workspace_existing_user_invited", { - workspaceId: id, - memberAdded: email, - memberAddedAt: new Date(), - invitedBy: authUser.email, - }); - return await prisma.workspaceMembers.create({ data: { id: ulid(),