feat(folders): adopted new strategy for rollback on folders

This commit is contained in:
akhilmhdh
2023-06-04 13:18:05 +05:30
parent 6ce0f48b2c
commit 668b5a9cfd
7 changed files with 188 additions and 113 deletions
@@ -1,6 +1,6 @@
import Link from 'next/link';
import { useRouter } from 'next/router';
import { faAngleRight, faHome } from '@fortawesome/free-solid-svg-icons';
import { faAngleRight } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { useOrganization, useWorkspace } from '@app/context';
@@ -114,7 +114,7 @@ export default function NavHeader({
) : (
<Link passHref legacyBehavior href={{ pathname: '/dashboard/[id]', query }}>
<a className="text-sm font-semibold text-primary/80 hover:text-primary">
{name === 'root' ? <FontAwesomeIcon icon={faHome} /> : name}
{name === 'root' ? '/' : name}
</a>
</Link>
)}
@@ -180,6 +180,7 @@ export const usePerformSecretRollback = () => {
return data;
},
onSuccess: (_, { workspaceId, environment, folderId }) => {
queryClient.invalidateQueries([{ workspaceId, environment }, 'secrets']);
queryClient.invalidateQueries(secretSnapshotKeys.list(workspaceId, environment, folderId));
queryClient.invalidateQueries(secretSnapshotKeys.count(workspaceId, environment, folderId));
}