mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix: Inviting all members when there's only 1 user in the organization
This commit is contained in:
@@ -238,6 +238,8 @@ export const projectMembershipServiceFactory = ({
|
|||||||
|
|
||||||
if (orgMembers.length !== emails.length) throw new BadRequestError({ message: "Some users are not part of org" });
|
if (orgMembers.length !== emails.length) throw new BadRequestError({ message: "Some users are not part of org" });
|
||||||
|
|
||||||
|
if (!orgMembers.length) return [];
|
||||||
|
|
||||||
const existingMembers = await projectMembershipDAL.find({
|
const existingMembers = await projectMembershipDAL.find({
|
||||||
projectId,
|
projectId,
|
||||||
$in: { userId: orgMembers.map(({ user }) => user.id).filter(Boolean) }
|
$in: { userId: orgMembers.map(({ user }) => user.id).filter(Boolean) }
|
||||||
|
|||||||
Reference in New Issue
Block a user