Skip to content

feat: 기사 반려 내역 조회 페이지 페이지네이션 추가 - #35

Merged
soooob43 merged 1 commit into
devfrom
feature/mover-received-requests-page
Jul 30, 2026
Merged

feat: 기사 반려 내역 조회 페이지 페이지네이션 추가#35
soooob43 merged 1 commit into
devfrom
feature/mover-received-requests-page

Conversation

@soooob43

@soooob43 soooob43 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

📋 작업 내용

  • 기사님 반려 내역 조회 페이지에 페이지네이션 추가했습니다.

🔥 변경 사항

  • 반려 내역 조회를 useInfiniteQuery 방식으로 변경
  • nextCursor를 사용해 다음 반려 내역 조회
  • IntersectionObserver로 목록 하단 진입 감지
  • 다음 페이지 데이터를 기존 목록에 이어서 표시
  • 다음 페이지 로딩 및 조회 실패 재시도 UI 추가
  • 페이지네이션 응답 구조에 맞게 API 응답 타입 변경

✅ 체크리스트

  • 로컬에서 정상 동작을 확인했습니다.
  • 기존 기능에 영향을 주지 않는지 확인했습니다.
  • 불필요한 console.log를 제거했습니다.
  • lint를 통과했습니다.
  • README 또는 문서를 수정했습니다. (필요 시)
  • API 명세와 일치하는지 확인했습니다.

📷 스크린샷 (선택)


🔗 관련 이슈

Closes #


💬 To Reviewer

Summary by CodeRabbit

  • 새로운 기능
    • 반려 요청 목록에 무한 스크롤 방식의 페이지네이션을 추가했습니다.
    • 목록을 스크롤하면 다음 요청이 자동으로 불러와집니다.
    • 추가 로딩 중 상태와 다음 페이지 불러오기 실패 시 재시도 기능을 제공합니다.
    • 반려 요청이 없을 때 안내 문구를 표시합니다.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

반려 요청 조회가 단발 조회에서 커서 기반 무한 스크롤로 변경되었습니다. API 응답에 페이지네이션 정보가 추가되었고, React Query 훅과 목록 화면이 다음 페이지 로딩 및 실패 재시도를 처리합니다.

Changes

반려 요청 무한 스크롤 페이징

Layer / File(s) Summary
페이지네이션 계약과 API 요청
src/types/moverEstimateRequest.ts, src/lib/api/moverEstimateRequests.ts
응답이 itemspagination을 포함하도록 변경되었으며, API 요청은 기본 limit과 선택적 cursor를 전송합니다.
무한 쿼리 커서 연결
src/hooks/useMoverEstimateRequests.ts
useInfiniteQuerypageParam을 API에 전달하고 nextCursor로 다음 페이지를 결정합니다.
무한 스크롤 목록과 상태 UI
src/components/estimate/RejectedRequestsPage.tsx
페이지 데이터를 평탄화하고 IntersectionObserver로 다음 페이지를 요청하며, 로딩·실패·재시도 상태를 표시합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RejectedRequestsPage
  participant useRejectedEstimateRequests
  participant getRejectedEstimateRequests
  participant RejectionsAPI
  RejectedRequestsPage->>useRejectedEstimateRequests: 초기 반려 요청 조회
  useRejectedEstimateRequests->>getRejectedEstimateRequests: cursor와 limit 전달
  getRejectedEstimateRequests->>RejectionsAPI: 페이지 요청
  RejectionsAPI-->>useRejectedEstimateRequests: items와 pagination 반환
  useRejectedEstimateRequests-->>RejectedRequestsPage: 목록과 다음 페이지 상태 제공
  RejectedRequestsPage->>RejectedRequestsPage: sentinel 교차 감지
  RejectedRequestsPage->>useRejectedEstimateRequests: fetchNextPage() 호출
Loading

Possibly related PRs

Suggested labels: 🏢코드리뷰

Suggested reviewers: juengseulki, youngmis

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 반려 내역 조회 페이지에 무한 스크롤 기반 페이지네이션을 추가한 변경과 잘 일치합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/mover-received-requests-page

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/lib/api/moverEstimateRequests.ts (1)

80-81: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

페이지 크기 기본값을 명명된 상수로 분리하세요.

새로 추가된 10은 목록 정책을 숨깁니다. 페이지 크기를 조정하거나 다른 호출부와 맞출 때 누락되지 않도록 의미 있는 상수로 관리하세요.

🤖 Prompt for 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.

In `@src/lib/api/moverEstimateRequests.ts` around lines 80 - 81, Extract the
default page-size value used by getRejectedEstimateRequests into a clearly named
module-level constant, and use that constant as the function parameter default.
Keep the existing limit behavior unchanged while making the pagination policy
reusable and easy to update.

Sources: Coding guidelines, Path instructions

🤖 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.

Nitpick comments:
In `@src/lib/api/moverEstimateRequests.ts`:
- Around line 80-81: Extract the default page-size value used by
getRejectedEstimateRequests into a clearly named module-level constant, and use
that constant as the function parameter default. Keep the existing limit
behavior unchanged while making the pagination policy reusable and easy to
update.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ae05e75-b365-4e7f-8dc0-0d8cebd1ebaa

📥 Commits

Reviewing files that changed from the base of the PR and between ba2d8aa and 7affba8.

📒 Files selected for processing (4)
  • src/components/estimate/RejectedRequestsPage.tsx
  • src/hooks/useMoverEstimateRequests.ts
  • src/lib/api/moverEstimateRequests.ts
  • src/types/moverEstimateRequest.ts

@juengseulki juengseulki left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

📋 PR 리뷰

👍 좋았던 점

  • 기존 일반 조회를 useInfiniteQuery로 자연스럽게 전환해 페이지별 데이터를 React Query에서 관리하도록 구성했습니다.
  • 백엔드의 nextCursor를 pageParam으로 그대로 전달해 커서 페이지네이션 흐름이 명확합니다.
  • 각 페이지의 items를 flatMap으로 합쳐 기존 카드 목록 렌더링 구조를 크게 변경하지 않았습니다.
  • IntersectionObserver에 rootMargin을 적용해 사용자가 목록 끝에 완전히 도달하기 전에 다음 데이터를 미리 요청하도록 처리했습니다.
  • 다음 페이지 존재 여부와 로딩 상태를 확인해 중복 요청을 방지했습니다.
  • Observer를 cleanup에서 해제해 컴포넌트 재렌더링이나 언마운트 시 구독이 남지 않도록 처리했습니다.
  • 초기 조회 실패와 다음 페이지 조회 실패를 구분해, 기존 목록을 유지하면서 다음 페이지만 재시도할 수 있도록 구성한 점이 좋았습니다.
  • 백엔드 응답 구조인 items, pagination.nextCursor, pagination.hasNextPage에 맞춰 프론트 타입도 정확하게 변경했습니다.

🔍 확인 및 제안

인라인 코멘트로 아래 내용을 남겼습니다.

  • 다음 페이지 재시도 버튼을 누른 동안에도 문구가 계속 다시 시도로 유지됩니다. 초기 조회 오류 UI처럼 로딩 문구 변경이나 버튼 비활성화를 적용하면 중복 클릭을 막고 진행 상태를 더 명확히 전달할 수 있을 것 같습니다.

전체적으로 백엔드에서 추가된 커서 페이지네이션 응답을 프론트의 useInfiniteQuery와 잘 연결했고, 초기 오류와 추가 조회 오류까지 나누어 처리한 점이 좋았습니다. 현재 변경에서 기능상 수정이 필요한 부분은 확인되지 않았습니다. 수고하셨습니다! 😊

Comment thread src/components/estimate/RejectedRequestsPage.tsx
@soooob43
soooob43 merged commit 0a5973e into dev Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants