mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
improvement: address feedback
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user