Skip to content
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

[FE] refactor: 무한스크롤 페이징 관련 api 변경 적용 #781

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

xodms0309
Copy link
Collaborator

@xodms0309 xodms0309 commented Oct 17, 2023

Issue

✨ 구현한 기능

  • 상품 목록 endpoint와 lastCursor 값이 page -> lastProductId 로 변경
  • 리뷰 목록 endpoint와 lastCursor 값이 page -> lastReviewId로 변경

📢 논의하고 싶은 내용

x

🎸 기타

레시피의 경우 아직 구현이 안되었다고 합니다

⏰ 일정

  • 추정 시간 :
  • 걸린 시간 : 1시간

@github-actions
Copy link

Test Results

2 tests   2 ✔️  0s ⏱️
1 suites  0 💤
1 files    0

Results for commit 547284e.

Copy link
Collaborator

@hae-on hae-on left a comment

Choose a reason for hiding this comment

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

수고했어영

Copy link
Collaborator

@Leejin-Yang Leejin-Yang left a comment

Choose a reason for hiding this comment

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

수고했어요! 질문 하나 남겼는데 확인해주세요~

@@ -6,7 +6,7 @@ import type { ProductReviewResponse } from '@/types/response';
const fetchProductReviews = async (pageParam: number, productId: number, sort: string) => {
const res = await productApi.get({
params: `/${productId}/reviews`,
queries: `?sort=${sort}&page=${pageParam}`,
queries: `?sort=${sort}&lastReviewId=${pageParam}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

요건 초기값 0으로 주는거죠??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넹 아래의 pageParam에서 초기값 0으로 설정하고 있습니다

Comment on lines +23 to +24
const lastCursor = prevResponse.reviews.length ? prevResponse.reviews[prevResponse.reviews.length - 1].id : 0;
return prevResponse.hasNext ? lastCursor : undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@xodms0309 xodms0309 merged commit 9342c22 into develop Oct 18, 2023
3 checks passed
@xodms0309 xodms0309 deleted the feat/issue-678 branch October 18, 2023 04:25
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.

[FE] 페이징 관련 api 변경 적용
3 participants