feat(ui): made corresponding changes in api call made from frontend

This commit is contained in:
=
2024-09-06 23:33:57 +05:30
parent 9d7bfae519
commit eb7c804bb9
3 changed files with 10 additions and 9 deletions

View File

@@ -150,8 +150,7 @@ export type DeletOrgMembershipDTO = {
export type AddUserToOrgDTO = {
inviteeEmails: string[];
projectIds?: string[];
projectRoleSlug?: string;
projects?: { id: string; projectRoleSlug: string }[];
organizationRoleSlug: string;
organizationId: string;
};

View File

@@ -129,8 +129,7 @@ export const AddOrgMemberModal = ({
organizationId: currentOrg?.id,
inviteeEmails: emails.split(",").map((email) => email.trim()),
organizationRoleSlug,
projectIds,
projectRoleSlug
projects: projectIds.map((id) => ({ id, projectRoleSlug }))
});
setCompleteInviteLinks(data?.completeInviteLinks ?? null);

View File

@@ -1,10 +1,11 @@
import { useMemo,useState } from "react";
import { useMemo, useState } from "react";
import {
faClock,
faEdit,
faMagnifyingGlass,
faTrash,
faUsers} from "@fortawesome/free-solid-svg-icons";
faUsers
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { twMerge } from "tailwind-merge";
@@ -27,12 +28,14 @@ import {
Th,
THead,
Tooltip,
Tr} from "@app/components/v2";
Tr
} from "@app/components/v2";
import {
ProjectPermissionActions,
ProjectPermissionSub,
useUser,
useWorkspace} from "@app/context";
useWorkspace
} from "@app/context";
import { useGetWorkspaceUsers } from "@app/hooks/api";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
import { TWorkspaceUser } from "@app/hooks/api/types";
@@ -104,7 +107,7 @@ export const MembersTable = ({ popUp, handlePopUpOpen, handlePopUpToggle }: Prop
{!isMembersLoading &&
filterdUsers?.map((projectMember, index) => {
const { user: u, inviteEmail, id: membershipId, roles } = projectMember;
const name = u ? `${u.firstName} ${u.lastName}` : "-";
const name = u.firstName || u.lastName ? `${u.firstName} ${u.lastName || ""}` : "-";
const email = u?.email || inviteEmail;
return (