Fix: 컨텍스트 메뉴 쿼리키 초기화 관련 수정

This commit is contained in:
정현조 2024-10-08 13:50:23 +09:00
parent eea5b77c9c
commit f92d62e4c3

View File

@ -87,8 +87,7 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc
}, },
{ {
onSuccess: () => { onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['folder', projectId, folderId] }); queryClient.invalidateQueries({ queryKey: ['folder'] });
queryClient.invalidateQueries({ queryKey: ['folder', projectId, node.id] });
onRefetch(); onRefetch();
}, },
} }
@ -102,7 +101,7 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc
{ projectId, folderId: node.id, memberId }, { projectId, folderId: node.id, memberId },
{ {
onSuccess: () => { onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['folder', projectId] }); queryClient.invalidateQueries({ queryKey: ['folder'] });
onRefetch(); onRefetch();
}, },
} }
@ -112,8 +111,8 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc
{ projectId, folderId, imageId: node.id }, { projectId, folderId, imageId: node.id },
{ {
onSuccess: () => { onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['folder', projectId] }); queryClient.invalidateQueries({ queryKey: ['folder'] });
queryClient.invalidateQueries({ queryKey: ['image', node.id] }); queryClient.invalidateQueries({ queryKey: ['image'] });
onRefetch(); onRefetch();
}, },
} }
@ -132,7 +131,7 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc
{ {
onSuccess: () => { onSuccess: () => {
console.log(folderId, node?.id); console.log(folderId, node?.id);
queryClient.invalidateQueries({ queryKey: ['folder', projectId] }); queryClient.invalidateQueries({ queryKey: ['folder'] });
onRefetch(); onRefetch();
}, },