[actions, reducers] getBrandCreatorsInfo 관련 로직 추가

Detail Notes :
This commit is contained in:
younghoon100.park
2024-02-26 13:22:49 +09:00
parent 369aebb569
commit 7279a1caff
2 changed files with 50 additions and 7 deletions

View File

@@ -145,6 +145,35 @@ export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
);
};
// Featured Brands Featured Creators 정보 조회 IF-LGSP-309
export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
const { hstNm, patnrId } = props;
const onSuccess = (response) => {
console.log("@@ getBrandCreatorsInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CREATORS_INFO,
payload: response.data.data,
});
};
const onFail = (error) => {
console.error("@@ getBrandCreatorsInfo onFail ", error);
};
TAxios(
dispatch,
getState,
"get",
URLS.GET_BRAND_CREATORS_INFO,
{ hstNm, patnrId },
{},
onSuccess,
onFail
);
};
// Featured Brand Best Seller 상품 목록 조회 IF-LGSP-312
export const getBrandBestSeller = (props) => (dispatch, getState) => {
const { patnrId } = props;

View File

@@ -7,6 +7,7 @@ const initialState = {
brandTsvInfoData: {},
brandBestSellerData: {},
brandRecommendedShowInfoData: {},
brandCreatorsInfoData: {},
};
export const brandReducer = (state = initialState, action) => {
@@ -35,15 +36,9 @@ export const brandReducer = (state = initialState, action) => {
brandTsvInfoData: action.payload,
};
case types.GET_BRAND_BEST_SELLER:
return {
...state,
brandBestSellerData: action.payload,
};
case types.GET_BRAND_RECOMMENDED_SHOW_INFO: {
const brandRecommendedShowInfo =
action.payload.brandRecommendedShowInfo.filter(
action.payload.brandRecommendedShowInfo?.filter(
(_, index) => index < 10
);
@@ -56,6 +51,25 @@ export const brandReducer = (state = initialState, action) => {
};
}
case types.GET_BRAND_CREATORS_INFO: {
const barndCreatorsShowInfo =
action.payload.barndCreatorsShowInfo?.filter((_, index) => index < 10);
return {
...state,
brandCreatorsInfoData: {
...action.payload,
barndCreatorsShowInfo,
},
};
}
case types.GET_BRAND_BEST_SELLER:
return {
...state,
brandBestSellerData: action.payload,
};
default:
return state;
}