[FeaturedBrandsPanel] issue fix, SHOPTIME-1933

This commit is contained in:
younghoon100.park
2024-06-17 17:01:53 +09:00
parent b522c839b8
commit e9cced552f
16 changed files with 325 additions and 324 deletions

View File

@@ -169,10 +169,39 @@ export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
// console.log("getBrandRecommendedShowInfo onSuccess", response.data);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
const brandRecommendedShowCategoryInfo =
response.data.data?.brandRecommendedShowCategoryInfo;
const brandRecommendedShowInfo =
response.data.data?.brandRecommendedShowInfo;
const firstCatCd = brandRecommendedShowCategoryInfo[0]?.catCd.toString();
let filteredBrandRecommendedShowInfo;
if (
brandRecommendedShowCategoryInfo &&
brandRecommendedShowInfo &&
firstCatCd
) {
if (catCd === undefined) {
filteredBrandRecommendedShowInfo = brandRecommendedShowInfo
.filter((showInfo) => firstCatCd === showInfo?.catCd)
.slice(0, 10);
} else {
filteredBrandRecommendedShowInfo = brandRecommendedShowInfo
.filter((showInfo) => catCd === showInfo?.catCd)
.slice(0, 10);
}
}
const data = {
brandRecommendedShowCategoryInfo,
brandRecommendedShowInfo: filteredBrandRecommendedShowInfo,
};
dispatch({
type: types.GET_BRAND_RECOMMENDED_SHOW_INFO,
payload: {
data: response.data.data,
data,
},
});
};