mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 17:00:56 +00:00
feat: resolving bugs in checklist testing
This commit is contained in:
+16
-3
@@ -19,6 +19,7 @@ import { useOrganization } from "@app/context";
|
||||
import { findOrgMembershipRole } from "@app/helpers/roles";
|
||||
import {
|
||||
useAddUsersToOrg,
|
||||
useAddUserToWsNonE2EE,
|
||||
useFetchServerStatus,
|
||||
useGetOrgRoles,
|
||||
useGetUserProjects
|
||||
@@ -76,6 +77,7 @@ export const AddOrgMemberModal = ({
|
||||
const { data: organizationRoles } = useGetOrgRoles(currentOrg?.id ?? "");
|
||||
const { data: serverDetails } = useFetchServerStatus();
|
||||
const { mutateAsync: addUsersMutateAsync } = useAddUsersToOrg();
|
||||
const { mutateAsync: addUserToProject } = useAddUserToWsNonE2EE();
|
||||
const { data: projects, isPending: isProjectsLoading } = useGetUserProjects({
|
||||
includeRoles: true
|
||||
});
|
||||
@@ -140,13 +142,24 @@ export const AddOrgMemberModal = ({
|
||||
return;
|
||||
}
|
||||
|
||||
const usernames = emails.split(",").map((email) => email.trim());
|
||||
const { data } = await addUsersMutateAsync({
|
||||
organizationId: currentOrg?.id,
|
||||
inviteeEmails: emails.split(",").map((email) => email.trim()),
|
||||
organizationRoleSlug: organizationRole.slug,
|
||||
projects: selectedProjects.map(({ id }) => ({ id, projectRoleSlug: [projectRoleSlug] }))
|
||||
inviteeEmails: usernames,
|
||||
organizationRoleSlug: organizationRole.slug
|
||||
});
|
||||
|
||||
await Promise.allSettled(
|
||||
selectedProjects.map((el) =>
|
||||
addUserToProject({
|
||||
orgId: currentOrg.id,
|
||||
projectId: el.id,
|
||||
roleSlugs: [projectRoleSlug],
|
||||
usernames
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
setCompleteInviteLinks(data?.completeInviteLinks ?? null);
|
||||
|
||||
// only show this notification when email is configured.
|
||||
|
||||
Reference in New Issue
Block a user