[251031] fix: UserReviewList Filtering
🕐 커밋 시간: 2025. 10. 31. 13:51:42 📊 변경 통계: • 총 파일: 1개 • 추가: +8줄 • 삭제: -8줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/actions/productActions.js 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선 • 코드 정리 및 최적화
This commit is contained in:
@@ -320,7 +320,7 @@ const fetchAllReviewsWithSequentialPaging = async (dispatch, getState, requestPa
|
||||
pageSize = 100, // 최대값으로 설정하여 페이징 횟수 최소화
|
||||
} = requestParams;
|
||||
|
||||
console.log('[UserReviewPanel] 🚀 순차 페이징 시작:', {
|
||||
console.log('[UserReviewList] 🚀 순차 페이징 시작:', {
|
||||
prdtId,
|
||||
patnrId,
|
||||
filterTpCd,
|
||||
@@ -348,7 +348,7 @@ const fetchAllReviewsWithSequentialPaging = async (dispatch, getState, requestPa
|
||||
// filterTpCd가 'ALL'이 아니면 filterTpVal 추가
|
||||
if (filterTpCd !== 'ALL') {
|
||||
if (!filterTpVal) {
|
||||
console.warn('[UserReviewPanel] ⚠️ filterTpCd가 ALL이 아니면 filterTpVal은 필수입니다');
|
||||
console.warn('[UserReviewList] ⚠️ filterTpCd가 ALL이 아니면 filterTpVal은 필수입니다');
|
||||
}
|
||||
params.filterTpVal = filterTpVal;
|
||||
}
|
||||
@@ -360,7 +360,7 @@ const fetchAllReviewsWithSequentialPaging = async (dispatch, getState, requestPa
|
||||
TAxios(dispatch, getState, 'get', URLS.GET_USER_REVIEW_LIST, params, {}, onSuccess, onFail);
|
||||
});
|
||||
|
||||
console.log(`[UserReviewPanel] 📄 페이지 ${pageNo} 응답:`, {
|
||||
console.log(`[UserReviewList] 📄 페이지 ${pageNo} 응답:`, {
|
||||
pageNo,
|
||||
reviewListLength: response.data?.data?.reviewDetail?.reviewList?.length || 0,
|
||||
totRvwCnt: response.data?.data?.reviewDetail?.totRvwCnt,
|
||||
@@ -371,7 +371,7 @@ const fetchAllReviewsWithSequentialPaging = async (dispatch, getState, requestPa
|
||||
const reviewData = extractReviewListApiData(response.data);
|
||||
|
||||
if (!reviewData || !reviewData.reviewList) {
|
||||
console.warn('[UserReviewPanel] ⚠️ 리뷰 데이터 추출 실패, 페이징 종료');
|
||||
console.warn('[UserReviewList] ⚠️ 리뷰 데이터 추출 실패, 페이징 종료');
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -383,7 +383,7 @@ const fetchAllReviewsWithSequentialPaging = async (dispatch, getState, requestPa
|
||||
// 5. 현재 페이지의 리뷰들을 전체 리스트에 추가
|
||||
allReviews = allReviews.concat(reviewData.reviewList);
|
||||
|
||||
console.log(`[UserReviewPanel] ✅ 페이지 ${pageNo} 수집 완료:`, {
|
||||
console.log(`[UserReviewList] ✅ 페이지 ${pageNo} 수집 완료:`, {
|
||||
pageNo,
|
||||
currentPageCount: reviewData.reviewList.length,
|
||||
totalCollected: allReviews.length,
|
||||
@@ -398,7 +398,7 @@ const fetchAllReviewsWithSequentialPaging = async (dispatch, getState, requestPa
|
||||
|
||||
if (receivedCount < pageSize || allReviews.length >= totalReviews) {
|
||||
hasMore = false;
|
||||
console.log('[UserReviewPanel] 📊 페이징 종료:', {
|
||||
console.log('[UserReviewList] 📊 페이징 종료:', {
|
||||
reason: receivedCount < pageSize ? '받은 개수 < pageSize' : '수집된 개수 >= 총 개수',
|
||||
receivedCount,
|
||||
pageSize,
|
||||
@@ -411,7 +411,7 @@ const fetchAllReviewsWithSequentialPaging = async (dispatch, getState, requestPa
|
||||
}
|
||||
|
||||
// 7. 모든 리뷰 수집 완료, Redux에 디스패치
|
||||
console.log('[UserReviewPanel] 🎉 모든 리뷰 수집 완료:', {
|
||||
console.log('[UserReviewList] 🎉 모든 리뷰 수집 완료:', {
|
||||
totalCollected: allReviews.length,
|
||||
totRvwCnt: currentReviewDetail?.totRvwCnt,
|
||||
pages: pageNo - 1
|
||||
@@ -433,7 +433,7 @@ const fetchAllReviewsWithSequentialPaging = async (dispatch, getState, requestPa
|
||||
payload: finalPayload
|
||||
};
|
||||
|
||||
console.log('[UserReviewPanel] 📦 Redux 디스패치:', {
|
||||
console.log('[UserReviewList] 📦 Redux 디스패치:', {
|
||||
actionType,
|
||||
totalReviews: allReviews.length,
|
||||
totRvwCnt: currentReviewDetail?.totRvwCnt,
|
||||
|
||||
Reference in New Issue
Block a user