Skip to content

Commit 398072e

Browse files
authored
Merge pull request #153 from kakao-tech-campus-3rd-step3/hotfix/reply-comment
fix: 대댓글 수정 미반영 문제 수정
2 parents e2eb24d + 4254b00 commit 398072e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/entities/comment/model/useUpdateComment.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,10 @@ export const useUpdateComment = () => {
1414
return useMutation({
1515
mutationFn: ({ commentId, body }: UpdateCommentVars) =>
1616
commentService.updateComment(commentId, body),
17-
onSuccess: (_data, variables) => {
18-
const { postId } = variables as UpdateCommentVars;
17+
onSuccess: () => {
1918
// 개별 댓글 상세 및 목록 계열 무효화]
20-
if (postId) {
21-
qc.invalidateQueries({ queryKey: commentKeys.all });
22-
qc.invalidateQueries({ queryKey: replyKeys.all });
23-
}
19+
qc.invalidateQueries({ queryKey: commentKeys.all });
20+
qc.invalidateQueries({ queryKey: replyKeys.all });
2421
},
2522
});
2623
};

0 commit comments

Comments
 (0)