From e2f49b74e90d47763f7eb0ac4e6756115078c473 Mon Sep 17 00:00:00 2001 From: olexh Date: Sun, 26 May 2024 17:12:14 +0300 Subject: [PATCH] fix: invalidate comments query cache --- features/comments/comment-list/comment-input.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/features/comments/comment-list/comment-input.tsx b/features/comments/comment-list/comment-input.tsx index 0545938f..99cb262e 100644 --- a/features/comments/comment-list/comment-input.tsx +++ b/features/comments/comment-list/comment-input.tsx @@ -48,7 +48,13 @@ const CommentInput: FC = forwardRef( const onSuccess = async () => { await queryClient.invalidateQueries({ - queryKey: ['comments', slug], + queryKey: ['comments', slug, content_type], + exact: false, + }); + + await queryClient.invalidateQueries({ + queryKey: ['commentThread'], + exact: false, }); editorRef.current?.setMarkdown('');