diff --git a/frontend/src/components/Header/WorkspaceNavigation.tsx b/frontend/src/components/Header/WorkspaceNavigation.tsx index 80df23e..a80fe05 100644 --- a/frontend/src/components/Header/WorkspaceNavigation.tsx +++ b/frontend/src/components/Header/WorkspaceNavigation.tsx @@ -19,7 +19,9 @@ export default function WorkspaceNavigation() { const workspaces = workspacesResponse?.workspaceResponses || []; const activeWorkspaceId = workspaceId ?? workspaces[0]?.id; - const activeProjectId: number = Number(location.pathname.split('/')[3] || '0'); + const activeProjectId: number = location.pathname.includes('/request') + ? 0 + : Number(location.pathname.split('/')[3] || '0'); if (workspaces.length === 0) { return
; diff --git a/frontend/src/components/WorkspaceSidebar/ProjectContextMenu.tsx b/frontend/src/components/WorkspaceSidebar/ProjectContextMenu.tsx index b690012..45b9215 100644 --- a/frontend/src/components/WorkspaceSidebar/ProjectContextMenu.tsx +++ b/frontend/src/components/WorkspaceSidebar/ProjectContextMenu.tsx @@ -87,8 +87,7 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc }, { onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['folder', projectId, folderId] }); - queryClient.invalidateQueries({ queryKey: ['folder', projectId, node.id] }); + queryClient.invalidateQueries({ queryKey: ['folder'] }); onRefetch(); }, } @@ -102,8 +101,7 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc { projectId, folderId: node.id, memberId }, { onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['folder', projectId, folderId] }); - queryClient.invalidateQueries({ queryKey: ['folder', projectId, node.id] }); + queryClient.invalidateQueries({ queryKey: ['folder'] }); onRefetch(); }, } @@ -113,8 +111,8 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc { projectId, folderId, imageId: node.id }, { onSuccess: () => { - queryClient.invalidateQueries({ queryKey: ['folder', projectId, folderId] }); - queryClient.invalidateQueries({ queryKey: ['image', node.id] }); + queryClient.invalidateQueries({ queryKey: ['folder'] }); + queryClient.invalidateQueries({ queryKey: ['image'] }); onRefetch(); }, } @@ -133,8 +131,7 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc { onSuccess: () => { console.log(folderId, node?.id); - queryClient.invalidateQueries({ queryKey: ['folder', projectId, folderId] }); - queryClient.invalidateQueries({ queryKey: ['folder', projectId, node?.id] }); + queryClient.invalidateQueries({ queryKey: ['folder'] }); onRefetch(); },