refactor: simplify user removal logic and enhance notification handling in UserProjectsSection

This commit is contained in:
Victor Santos
2025-11-03 16:43:12 -03:00
parent f2f50f739e
commit edd34f5561

View File

@@ -31,19 +31,11 @@ export const UserProjectsSection = ({ membershipId }: Props) => {
] as const);
const handleRemoveUser = async (projectId: string, username: string) => {
try {
await removeUserFromWorkspace({ projectId, usernames: [username], orgId });
createNotification({
text: "Successfully removed user from project",
type: "success"
});
} catch (error) {
console.error(error);
createNotification({
text: "Failed to remove user from the project",
type: "error"
});
}
await removeUserFromWorkspace({ projectId, usernames: [username], orgId });
createNotification({
text: "Successfully removed user from project",
type: "success"
});
handlePopUpClose("removeUserFromProject");
};