-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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.
수고했어영
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.
수고했어요! 질문 하나 남겼는데 확인해주세요~
@@ -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}`, |
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.
요건 초기값 0으로 주는거죠??
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.
넹 아래의 pageParam에서 초기값 0으로 설정하고 있습니다
const lastCursor = prevResponse.reviews.length ? prevResponse.reviews[prevResponse.reviews.length - 1].id : 0; | ||
return prevResponse.hasNext ? lastCursor : undefined; |
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.
👍
This reverts commit 9342c22.
Issue
✨ 구현한 기능
page
->lastProductId
로 변경page
->lastReviewId
로 변경📢 논의하고 싶은 내용
x
🎸 기타
레시피의 경우 아직 구현이 안되었다고 합니다
⏰ 일정