[actions, reducers] getBrandSeriesInfo, getBrandCategoryInfo 관련 로직 추가

Detail Notes :
This commit is contained in:
younghoon100.park
2024-02-26 14:46:41 +09:00
parent 59d985bb7e
commit 85808ac78a
2 changed files with 75 additions and 1 deletions

View File

@@ -174,6 +174,64 @@ export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
);
};
// Featured Brands Series 정보 조회 IF-LGSP-310
export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
const { patnrId, seriesId } = props;
const onSuccess = (response) => {
console.log("@@ getBrandSeriesInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_SERIES_INFO,
payload: response.data.data,
});
};
const onFail = (error) => {
console.error("@@ getBrandSeriesInfo onFail ", error);
};
TAxios(
dispatch,
getState,
"get",
URLS.GET_BRAND_SERIES_INFO,
{ patnrId, seriesId },
{},
onSuccess,
onFail
);
};
// Featured Brands 카테고리별 상품 조회 IF-LGSP-311
export const getBrandCategoryInfo = (props) => (dispatch, getState) => {
const { catCdLv1, catCdLv2, patnrId } = props;
const onSuccess = (response) => {
console.log("@@ getBrandCategoryInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CATEGORY_INFO,
payload: response.data.data,
});
};
const onFail = (error) => {
console.error("@@ getBrandCategoryInfo onFail ", error);
};
TAxios(
dispatch,
getState,
"get",
URLS.GET_BRAND_CATEGORY_INFO,
{ catCdLv1, catCdLv2, patnrId },
{},
onSuccess,
onFail
);
};
// Featured Brand Best Seller 상품 목록 조회 IF-LGSP-312
export const getBrandBestSeller = (props) => (dispatch, getState) => {
const { patnrId } = props;

View File

@@ -5,9 +5,11 @@ const initialState = {
brandLayoutInfoData: {},
brandLiveChannelInfoData: {},
brandTsvInfoData: {},
brandBestSellerData: {},
brandRecommendedShowInfoData: {},
brandCreatorsInfoData: {},
brandSeriesInfoData: {},
brandCategoryInfoData: {},
brandBestSellerData: {},
};
export const brandReducer = (state = initialState, action) => {
@@ -64,6 +66,20 @@ export const brandReducer = (state = initialState, action) => {
};
}
case types.GET_BRAND_SERIES_INFO: {
return {
...state,
brandSeriesInfoData: action.payload,
};
}
case types.GET_BRAND_CATEGORY_INFO: {
return {
...state,
brandCategoryInfoData: action.payload,
};
}
case types.GET_BRAND_BEST_SELLER:
return {
...state,