[actions, reducers] BRAND_TODAYS_DEALS 관련 변수 및 로직 추가

Detail Notes :

1. actionTypes, actions, reducer 추가
This commit is contained in:
younghoon100.park
2024-02-08 14:13:06 +09:00
parent 55df85e912
commit 95f49f7e45
3 changed files with 37 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ export const types = {
GET_BRAND_LIST: "GET_BRAND_LIST", GET_BRAND_LIST: "GET_BRAND_LIST",
GET_BRAND_LAYOUT_INFO: "GET_BRAND_LAYOUT_INFO", GET_BRAND_LAYOUT_INFO: "GET_BRAND_LAYOUT_INFO",
GET_BRAND_LIVE_CHANNEL_INFO: "GET_BRAND_LIVE_CHANNEL_INFO", GET_BRAND_LIVE_CHANNEL_INFO: "GET_BRAND_LIVE_CHANNEL_INFO",
GET_BRAND_TODAYS_DEALS: "GET_BRAND_TODAYS_DEALS",
// main actions // main actions
GET_SUB_CATEGORY: "GET_SUB_CATEGORY", GET_SUB_CATEGORY: "GET_SUB_CATEGORY",

View File

@@ -87,3 +87,32 @@ export const getBrandLiveChannelInfo = (props) => (dispatch, getState) => {
onFail 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
);
};

View File

@@ -4,6 +4,7 @@ const initialState = {
brandInfoData: {}, brandInfoData: {},
brandLayoutInfoData: {}, brandLayoutInfoData: {},
brandLiveChannelInfoData: {}, brandLiveChannelInfoData: {},
brandTsvInfoData: {},
}; };
export const brandReducer = (state = initialState, action) => { export const brandReducer = (state = initialState, action) => {
@@ -26,6 +27,12 @@ export const brandReducer = (state = initialState, action) => {
brandLiveChannelInfoData: action.payload, brandLiveChannelInfoData: action.payload,
}; };
case types.GET_BRAND_TODAYS_DEALS:
return {
...state,
brandTsvInfoData: action.payload,
};
default: default:
return state; return state;
} }