Fix: 리뷰 수락 거절 생성 삭제 후 캐시 삭제를 쿼리 추가

This commit is contained in:
정현조 2024-10-04 14:51:26 +09:00
parent 82ed776c9d
commit 8debec1ec5
4 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,7 @@ export default function useApproveReviewQuery({ projectId, reviewId, memberId }:
mutationFn: () => approveReview(projectId, reviewId),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['reviewDetail', projectId, reviewId, memberId] });
queryClient.invalidateQueries({ queryKey: ['reviewByStatus', projectId, reviewId, memberId] });
},
});
}

View File

@ -18,6 +18,7 @@ export default function useCreateReviewQuery() {
onSuccess: (_, variables) => {
queryClient.invalidateQueries({ queryKey: ['reviewDetail', variables.projectId] });
queryClient.invalidateQueries({ queryKey: ['reviewByStatus', variables.projectId] });
},
});
}

View File

@ -9,6 +9,7 @@ export default function useDeleteReviewQuery() {
deleteReview(projectId, reviewId, memberId),
onSuccess: (_, variables) => {
queryClient.invalidateQueries({ queryKey: ['reviewDetail', variables.projectId, variables.reviewId] });
queryClient.invalidateQueries({ queryKey: ['reviewByStatus', variables.projectId, variables.reviewId] });
},
});
}

View File

@ -14,6 +14,7 @@ export default function useRejectReviewQuery({ projectId, reviewId, memberId }:
mutationFn: () => rejectReview(projectId, reviewId),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['reviewDetail', projectId, reviewId, memberId] });
queryClient.invalidateQueries({ queryKey: ['reviewByStatus', projectId, reviewId, memberId] });
},
});
}