mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 13:28:34 +00:00
refactor: simplify user removal logic and enhance notification handling in UserProjectsSection
This commit is contained in:
+5
-13
@@ -31,19 +31,11 @@ export const UserProjectsSection = ({ membershipId }: Props) => {
|
|||||||
] as const);
|
] as const);
|
||||||
|
|
||||||
const handleRemoveUser = async (projectId: string, username: string) => {
|
const handleRemoveUser = async (projectId: string, username: string) => {
|
||||||
try {
|
await removeUserFromWorkspace({ projectId, usernames: [username], orgId });
|
||||||
await removeUserFromWorkspace({ projectId, usernames: [username], orgId });
|
createNotification({
|
||||||
createNotification({
|
text: "Successfully removed user from project",
|
||||||
text: "Successfully removed user from project",
|
type: "success"
|
||||||
type: "success"
|
});
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
createNotification({
|
|
||||||
text: "Failed to remove user from the project",
|
|
||||||
type: "error"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
handlePopUpClose("removeUserFromProject");
|
handlePopUpClose("removeUserFromProject");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user