Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

improvement: address feedback

Scott Wilson7e05bc86a994
diff --git a/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx b/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx
index ca68a6bb19..8995c03b3a 100644
--- a/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx
+++ b/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx
@@ -47,29 +47,25 @@ const Content = ({ role, onClose }: ContentProps) => {
const navigate = useNavigate();
const handleDuplicateRole = async (form: FormData) => {
- try {
- const newRole = await createRole.mutateAsync({
- orgId: role.orgId,
- permissions: role.permissions,
- ...form
- });
-
- createNotification({
- type: "success",
- text: "Role duplicated successfully"
- });
-
- navigate({
- to: "/organization/roles/$roleId",
- params: {
- roleId: newRole.id
- }
- });
-
- onClose();
- } catch {
- // query client creates notification
- }
+ const newRole = await createRole.mutateAsync({
+ orgId: role.orgId,
+ permissions: role.permissions,
+ ...form
+ });
+
+ createNotification({
+ type: "success",
+ text: "Role duplicated successfully"
+ });
+
+ navigate({
+ to: "/organization/roles/$roleId",
+ params: {
+ roleId: newRole.id
+ }
+ });
+
+ onClose();
};
return (
diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/DuplicateProjectRoleModal.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/DuplicateProjectRoleModal.tsx
index 4e06a845f0..4ac54e9730 100644
--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/DuplicateProjectRoleModal.tsx
+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/DuplicateProjectRoleModal.tsx
@@ -49,30 +49,26 @@ const Content = ({ role, onClose }: ContentProps) => {
const navigate = useNavigate();
const handleDuplicateRole = async (form: FormData) => {
- try {
- const newRole = await createRole.mutateAsync({
- projectId: currentWorkspace.id,
- permissions: role.permissions,
- ...form
- });
-
- createNotification({
- type: "success",
- text: "Role duplicated successfully"
- });
-
- navigate({
- to: `/${currentWorkspace.type}/$projectId/roles/$roleSlug` as const,
- params: {
- roleSlug: newRole.slug,
- projectId: currentWorkspace.id
- }
- });
-
- onClose();
- } catch {
- // query client creates notification
- }
+ const newRole = await createRole.mutateAsync({
+ projectId: currentWorkspace.id,
+ permissions: role.permissions,
+ ...form
+ });
+
+ createNotification({
+ type: "success",
+ text: "Role duplicated successfully"
+ });
+
+ navigate({
+ to: `/${currentWorkspace.type}/$projectId/roles/$roleSlug` as const,
+ params: {
+ roleSlug: newRole.slug,
+ projectId: currentWorkspace.id
+ }
+ });
+
+ onClose();
};
return (