feat: 기사 내 견적 관리 및 상세 페이지 API 연동 - #44
Conversation
…into feature/mover-received-requests-page
…into feature/mover-received-requests-page
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
🚧 Files skipped from review as they are similar to previous changes (11)
📝 WalkthroughWalkthrough보낸 견적 목록과 상세 화면을 목업 데이터에서 API 조회 방식으로 변경했습니다. 무한 스크롤, 로딩·오류·빈 결과 상태, 재시도, 견적 경로와 타입을 추가했습니다. 반려 요청 화면의 상태 표시도 공통 컴포넌트로 통합했습니다. Changes보낸 견적 조회 흐름
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant SentEstimatesPage
participant useSentEstimates
participant fetchSentEstimates
participant EstimatesAPI
SentEstimatesPage->>useSentEstimates: 목록 조회 요청
useSentEstimates->>fetchSentEstimates: 페이지와 제한값 전달
fetchSentEstimates->>EstimatesAPI: 보낸 견적 목록 요청
EstimatesAPI-->>fetchSentEstimates: 목록과 다음 페이지 정보 반환
fetchSentEstimates-->>useSentEstimates: 조회 결과 반환
useSentEstimates-->>SentEstimatesPage: 카드 데이터와 페이지 상태 반환
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/estimate/sent/SentEstimateDetailPage.tsx`:
- Around line 73-89: SentEstimateDetailPage에서 useSentEstimateDetail 호출 직후
estimateId 유효성을 먼저 검사하고, 유효하지 않은 ID는 로딩 상태가 아닌 오류 상태 또는 목록 이동 동작으로 처리하세요. 유효한
ID에 대해서만 기존 query.isPending, query.isError, query.data 분기를 적용해 무한 로딩을 방지하세요.
In `@src/components/estimate/sent/SentEstimatesPage.tsx`:
- Around line 16-32: Update the infinite-scroll effect in SentEstimatesPage to
read isFetchNextPageError from the query and prevent creating or re-registering
the IntersectionObserver when that error state is true; include it in the effect
dependencies. Add a user-triggered retry control for the failed next-page
request, wired to the query’s retry behavior, so automatic retries remain
disabled until the user retries.
In `@src/lib/api/moverEstimateRequests.ts`:
- Line 38: Move the complete request-list, estimate-submit, rejection, and
rejection-list endpoint paths into API_ROUTES in apiRoutes.ts, including the
existing "/requests", "/reject", and "/rejections" segments. Update the affected
functions in moverEstimateRequests.ts to use only the resulting API_ROUTES
constants and remove direct path-string composition.
In `@src/lib/api/sentEstimates.ts`:
- Around line 1-3: sentEstimates API의 브라우저 요청 구현에서 fetchInstance를 제거하고 프로젝트의
axiosInstance를 사용하도록 변경하세요. 응답은 success와 data 계약을 명시적으로 확인해 성공 데이터를 반환하고, 실패 응답은
error.code 기준으로 기존 변환 규칙에 따라 처리하세요. useSentEstimates와 useSentEstimateDetail에서
사용하는 모든 요청 경로에 동일하게 적용하세요.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 6fc381a2-73f4-4d40-a2d6-c50987b654f7
📒 Files selected for processing (10)
src/components/estimate/RejectedRequestsPage.tsxsrc/components/estimate/sent/SentEstimateDetailPage.tsxsrc/components/estimate/sent/SentEstimatesPage.tsxsrc/hooks/useSentEstimates.tssrc/lib/api/moverEstimateRequests.tssrc/lib/api/sentEstimates.tssrc/lib/constants/apiRoutes.tssrc/lib/constants/appRoutes.tssrc/lib/constants/queryKeys.tssrc/types/sentEstimate.ts
juengseulki
left a comment
There was a problem hiding this comment.
📋 PR 리뷰
👍 좋았던 점
- 보낸 견적 목록과 상세 화면을 실제 백엔드 API로 연동하면서 목업 데이터를 깔끔하게 제거했습니다.
- API 호출을 React Query 훅으로 분리해 컴포넌트와 데이터 조회 로직의 책임을 명확하게 나눈 점이 좋았습니다.
- 상세 화면에서 고객명, 이사 유형, 견적 금액, 요청일, 이용일, 출발지·도착지 등 필요한 정보를 API 응답으로 자연스럽게 매핑했습니다.
- 완료된 견적에서 상세 페이지로 이동하는 기존 UI 흐름을 유지하면서 실제 데이터만 연결해 변경 범위를 최소화했습니다.
/api중복 경로를 함께 정리해 실제 호출 경로를 맞춘 점도 좋았습니다.
🔍 확인 및 제안
인라인 코멘트로 아래 내용을 남겼습니다.
- React Query 훅으로 API 조회 로직을 분리한 점이 좋았습니다.
- 하드코딩 데이터를 제거하고 기존 UI를 유지한 채 실제 API 응답으로 교체한 점이 좋았습니다.
appRoutes,apiRoutes,queryKeys는 현재 충돌을 고려해 제외하신 것으로 이해했는데, 관련 PR들이 정리된 이후 한 번에 통합하는 방향인지 궁금했습니다.
전체적으로 목업 구현을 실제 API 연동으로 자연스럽게 전환한 PR이었습니다. 기존 화면 구조를 크게 변경하지 않으면서 데이터만 실제 API로 교체해 변경 범위를 최소화한 점이 좋았고, React Query 구조도 이후 유지보수하기 쉬운 형태로 잘 정리된 것 같습니다. 수고하셨습니다! 😊
📋 작업 내용
🔥 변경 사항
✅ 체크리스트
📷 스크린샷 (선택)
🔗 관련 이슈
Closes #
💬 To Reviewer
다만 나연님께 헤더 관련 경로를 전달드린 상태이고, 해당 파일들은 현재 슬기님께서 수정 중인 것으로 알고 있어 제가 함께 수정하면 경로가 꼬이거나 충돌이 발생할 수 있을 것 같아 우선 변경하지 않았습니다.
제가 수정하는 방향이 맞다면 편하게 말씀 부탁드립니다! 확인 후 수정해서 해당 PR에 포함하겠습니다.
Summary by CodeRabbit
새 기능
개선