[251209] feat: NBCU-ShopByShow-7
🕐 커밋 시간: 2025. 12. 09. 17:04:16 📊 변경 통계: • 총 파일: 1개 • 추가: +16줄 • 삭제: -2줄 📝 수정된 파일: ~ com.twin.app.shoptime/src/reducers/brandReducer.js 🔧 주요 변경 내용: • 핵심 비즈니스 로직 개선
This commit is contained in:
@@ -159,11 +159,25 @@ export const brandReducer = (state = initialState, action) => {
|
|||||||
brandRecentlyAiredData: action.payload,
|
brandRecentlyAiredData: action.payload,
|
||||||
};
|
};
|
||||||
|
|
||||||
case types.GET_BRAND_SHOP_BY_SHOW:
|
case types.GET_BRAND_SHOP_BY_SHOW: {
|
||||||
|
// 일부 응답은 리스트 없이 내려와 기존 데이터를 덮어 지우는 문제가 있어 조건부 병합
|
||||||
|
const prevData = state.brandShopByShowData?.data || {};
|
||||||
|
const nextData = action.payload?.data || {};
|
||||||
|
const hasNextList = Array.isArray(nextData.brandShopByShowContsList);
|
||||||
|
|
||||||
|
// 리스트가 없으면 이전 리스트 유지
|
||||||
|
const mergedData = hasNextList
|
||||||
|
? nextData
|
||||||
|
: { ...prevData, ...nextData, brandShopByShowContsList: prevData.brandShopByShowContsList };
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
brandShopByShowData: action.payload,
|
brandShopByShowData: {
|
||||||
|
...action.payload,
|
||||||
|
data: mergedData,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
case types.SET_BRAND_LIVE_CHANNEL_UPCOMING:
|
case types.SET_BRAND_LIVE_CHANNEL_UPCOMING:
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user