mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 21:26:04 +00:00
improvement: address feedback
This commit is contained in:
@@ -47,29 +47,25 @@ const Content = ({ role, onClose }: ContentProps) => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const handleDuplicateRole = async (form: FormData) => {
|
const handleDuplicateRole = async (form: FormData) => {
|
||||||
try {
|
const newRole = await createRole.mutateAsync({
|
||||||
const newRole = await createRole.mutateAsync({
|
orgId: role.orgId,
|
||||||
orgId: role.orgId,
|
permissions: role.permissions,
|
||||||
permissions: role.permissions,
|
...form
|
||||||
...form
|
});
|
||||||
});
|
|
||||||
|
|
||||||
createNotification({
|
createNotification({
|
||||||
type: "success",
|
type: "success",
|
||||||
text: "Role duplicated successfully"
|
text: "Role duplicated successfully"
|
||||||
});
|
});
|
||||||
|
|
||||||
navigate({
|
navigate({
|
||||||
to: "/organization/roles/$roleId",
|
to: "/organization/roles/$roleId",
|
||||||
params: {
|
params: {
|
||||||
roleId: newRole.id
|
roleId: newRole.id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
} catch {
|
|
||||||
// query client creates notification
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
+17
-21
@@ -49,30 +49,26 @@ const Content = ({ role, onClose }: ContentProps) => {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const handleDuplicateRole = async (form: FormData) => {
|
const handleDuplicateRole = async (form: FormData) => {
|
||||||
try {
|
const newRole = await createRole.mutateAsync({
|
||||||
const newRole = await createRole.mutateAsync({
|
projectId: currentWorkspace.id,
|
||||||
projectId: currentWorkspace.id,
|
permissions: role.permissions,
|
||||||
permissions: role.permissions,
|
...form
|
||||||
...form
|
});
|
||||||
});
|
|
||||||
|
|
||||||
createNotification({
|
createNotification({
|
||||||
type: "success",
|
type: "success",
|
||||||
text: "Role duplicated successfully"
|
text: "Role duplicated successfully"
|
||||||
});
|
});
|
||||||
|
|
||||||
navigate({
|
navigate({
|
||||||
to: `/${currentWorkspace.type}/$projectId/roles/$roleSlug` as const,
|
to: `/${currentWorkspace.type}/$projectId/roles/$roleSlug` as const,
|
||||||
params: {
|
params: {
|
||||||
roleSlug: newRole.slug,
|
roleSlug: newRole.slug,
|
||||||
projectId: currentWorkspace.id
|
projectId: currentWorkspace.id
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onClose();
|
onClose();
|
||||||
} catch {
|
|
||||||
// query client creates notification
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user