Skip to content

Conversation

@llmojoll
Copy link
Collaborator

📦 Pull Request

📝 요약(Summary)

  • react-query를 이용해서 삭제하기 구현했습니다.
  • 삭제하기는 버튼이 따로 없어서 버튼은 없애버렸구요 trigger에 따로 엘리먼트 넣어주시면 될 것 같습니다
  • type 프롭스 wine과 review정해주시면 될 것 같습니다

💬 공유사항 to 리뷰어

🗂️ 관련 이슈

📸 스크린샷

image image

✅ 체크리스트

  • 빌드 및 테스트 통과
  • ESLint/Prettier 검사 통과

@llmojoll llmojoll requested review from Luganic and summerDev96 July 29, 2025 06:54
@vercel
Copy link

vercel bot commented Jul 29, 2025

@llmojoll is attempting to deploy a commit to the 626-ju's projects Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines +29 to +48
deleteWineMutation.mutate(id, {
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['wines'] }); //삭제후 관련데이터 바로 갱신
console.log('와인 삭제 성공');
setShowDeleteModal(false);
},
onError: (error) => {
console.error('와인 삭제 실패', error);
},
});
} else if (type === 'review') {
deleteReviewMutation.mutate(id, {
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['reviews'] });
console.log('리뷰 삭제 성공');
setShowDeleteModal(false);
},
onError: (error) => {
console.error('리뷰 삭제 실패', error);
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 방법으로 onSuccess, onError 처리도 가능하군요? 항상 Mutation 선언할 때만 썼는데 새롭네요

@llmojoll llmojoll merged commit 355e13a into codeit-part3-7:dev Jul 29, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants