-
Notifications
You must be signed in to change notification settings - Fork 0
[Fix] Axios 인스턴스에 공통 응답(에러 포함) 처리 함수 추가 #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
🎨 Storybook Reportℹ️ Story 변경사항이 감지되지 않았습니다 이 PR에는 Story 변경이 없어서 빌드를 스킵했습니다.
|
📊 Coverage Report
📉 #127을 main에 병합하면 coverage가 Coverage 요약@@ Coverage Diff @@
## main #127 +/- ##
===========================================
- Coverage 28.45% 28.16% -0.29%
===========================================
Files 120 121 +1
Lines 4685 4732 +47
Branches 216 217 +1
===========================================
Hits 1333 1333 0
+ Misses 3352 3399 +47 영향받은 파일✅ 이 PR로 영향받은 파일이 없습니다 수정된 모든 파일이 현재 coverage를 유지했습니다. |
🚀 PR Preview Report✨ Build가 성공적으로 완료되었습니다. Preview에서 변경사항을 확인하세요.
|
wooktori
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다~~
📝 변경 사항
Tip
이 변경사항은 기존 axios 인스턴스(baseAPI)를 수정하지 않았기 때문에 breaking change가 아닙니다.
🎯 목적
백엔드의 공통 응답 형식(
CommonSuccessResponse<T>)을 자동으로 처리하여,클라이언트 코드에서는 실제 데이터(
T)만 다루게 됩니다.💡 공통 응답 Type 추가
💡 공통 응답 처리 헬퍼 함수 추가 (
api)공통 응답 형식에서 data 필드만 추출하여 반환합니다.
💡 React Query 에러 타입 전역 설정
모든
useQuery에서 자동으로CommonErrorResponse타입 추론됩니다.💡 Mock Data 용 응답 처리 헬퍼 함수 추가
MSW 핸들러에서 공통 응답 형식을 생성할 수 있습니다.
✨ 마이그레이션 가이드
API 호출 변경
React Query 에러 처리
MSW 핸들러
🔗 관련 이슈
Closes #125
🧪 테스트 방법
📸 스크린샷 (선택)
📋 체크리스트
💬 추가 코멘트
CodeRabbit Review는 자동으로 실행되지 않습니다.
Review를 실행하려면 comment에 아래와 같이 작성해주세요