diff --git a/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx b/frontend/src/pages/organization/RoleByIDPage/components/DuplicateOrgRoleModal.tsx index ca68a6bb1..8995c03b3 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 - }); + const newRole = await createRole.mutateAsync({ + orgId: role.orgId, + permissions: role.permissions, + ...form + }); - createNotification({ - type: "success", - text: "Role duplicated successfully" - }); + createNotification({ + type: "success", + text: "Role duplicated successfully" + }); - navigate({ - to: "/organization/roles/$roleId", - params: { - roleId: newRole.id - } - }); + navigate({ + to: "/organization/roles/$roleId", + params: { + roleId: newRole.id + } + }); - onClose(); - } catch { - // query client creates notification - } + onClose(); }; return ( diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/DuplicateProjectRoleModal.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/DuplicateProjectRoleModal.tsx index 4e06a845f..4ac54e973 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 - }); + const newRole = await createRole.mutateAsync({ + projectId: currentWorkspace.id, + permissions: role.permissions, + ...form + }); - createNotification({ - type: "success", - text: "Role duplicated successfully" - }); + createNotification({ + type: "success", + text: "Role duplicated successfully" + }); - navigate({ - to: `/${currentWorkspace.type}/$projectId/roles/$roleSlug` as const, - params: { - roleSlug: newRole.slug, - projectId: currentWorkspace.id - } - }); + navigate({ + to: `/${currentWorkspace.type}/$projectId/roles/$roleSlug` as const, + params: { + roleSlug: newRole.slug, + projectId: currentWorkspace.id + } + }); - onClose(); - } catch { - // query client creates notification - } + onClose(); }; return (