[actions, reducers] BRAND_TODAYS_DEALS 관련 변수 및 로직 추가
Detail Notes : 1. actionTypes, actions, reducer 추가
This commit is contained in:
@@ -26,6 +26,7 @@ export const types = {
|
||||
GET_BRAND_LIST: "GET_BRAND_LIST",
|
||||
GET_BRAND_LAYOUT_INFO: "GET_BRAND_LAYOUT_INFO",
|
||||
GET_BRAND_LIVE_CHANNEL_INFO: "GET_BRAND_LIVE_CHANNEL_INFO",
|
||||
GET_BRAND_TODAYS_DEALS: "GET_BRAND_TODAYS_DEALS",
|
||||
|
||||
// main actions
|
||||
GET_SUB_CATEGORY: "GET_SUB_CATEGORY",
|
||||
|
||||
@@ -87,3 +87,32 @@ export const getBrandLiveChannelInfo = (props) => (dispatch, getState) => {
|
||||
onFail
|
||||
);
|
||||
};
|
||||
|
||||
// Featured Brands Today's Deals 정보 조회 IF-LGSP-307
|
||||
export const getBrandTSVInfo = (props) => (dispatch, getState) => {
|
||||
const { patnrId } = props;
|
||||
|
||||
const onSuccess = (response) => {
|
||||
console.log("@@ getBrandTSVInfo onSuccess ", response.data);
|
||||
|
||||
dispatch({
|
||||
type: types.GET_BRAND_TODAYS_DEALS,
|
||||
payload: response.data.data,
|
||||
});
|
||||
};
|
||||
|
||||
const onFail = (error) => {
|
||||
console.error("@@ getBrandTSVInfo onFail ", error);
|
||||
};
|
||||
|
||||
TAxios(
|
||||
dispatch,
|
||||
getState,
|
||||
"get",
|
||||
URLS.GET_BRAND_TODAYS_DEALS,
|
||||
{ patnrId },
|
||||
{},
|
||||
onSuccess,
|
||||
onFail
|
||||
);
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ const initialState = {
|
||||
brandInfoData: {},
|
||||
brandLayoutInfoData: {},
|
||||
brandLiveChannelInfoData: {},
|
||||
brandTsvInfoData: {},
|
||||
};
|
||||
|
||||
export const brandReducer = (state = initialState, action) => {
|
||||
@@ -26,6 +27,12 @@ export const brandReducer = (state = initialState, action) => {
|
||||
brandLiveChannelInfoData: action.payload,
|
||||
};
|
||||
|
||||
case types.GET_BRAND_TODAYS_DEALS:
|
||||
return {
|
||||
...state,
|
||||
brandTsvInfoData: action.payload,
|
||||
};
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user