[FeaturedBrandsPanel] section, LIVE CHANNELS, 라이브 방송시 데이터 30초 단위로 feaching

Detail Notes :

1. 현재 주석 처리
2. action type, reducer 재설정
This commit is contained in:
younghoon100.park
2024-04-23 13:31:20 +09:00
parent 87d3fde4f6
commit 73144f969f
4 changed files with 54 additions and 4 deletions

View File

@@ -53,6 +53,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_CHAN_INFO: "GET_BRAND_CHAN_INFO",
GET_BRAND_TSV_INFO: "GET_BRAND_TSV_INFO",
GET_BRAND_RECOMMENDED_SHOW_INFO: "GET_BRAND_RECOMMENDED_SHOW_INFO",
GET_BRAND_SERIES_INFO: "GET_BRAND_SERIES_INFO",

View File

@@ -119,6 +119,36 @@ export const getBrandLiveChannelInfo = (props) => (dispatch, getState) => {
);
};
export const getBrandChanInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;
const onSuccess = (response) => {
// console.log("getBrandChanInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CHAN_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
const onFail = (error) => {
console.error("getBrandChanInfo onFail ", error);
};
TAxios(
dispatch,
getState,
"get",
URLS.GET_BRAND_LIVE_CHANNEL_INFO,
{ patnrId },
{},
onSuccess,
onFail
);
};
// Featured Brands Today's Deals 정보 조회 IF-LGSP-307
export const getBrandTSVInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;

View File

@@ -72,6 +72,26 @@ export const brandReducer = (state = initialState, action) => {
brandLiveChannelInfoData: action.payload,
};
case types.GET_BRAND_CHAN_INFO:
const brandChanInfo =
action.payload && action.payload.data?.brandChanInfo;
console.log("pyh brandChanInfo", brandChanInfo[0]?.brandProductInfo);
console.log(
"pyh brandChanInfo",
brandChanInfo[0]?.brandProductInfo?.length
);
return {
...state,
brandLiveChannelInfoData: {
...state.brandLiveChannelInfoData,
data: {
...state.brandLiveChannelInfoData.data,
brandChanInfo,
},
},
};
case types.GET_BRAND_TSV_INFO:
return {
...state,

View File

@@ -10,7 +10,7 @@ import LiveChannelsHorizontalContents from "./LiveChannelsHorizontalContents/Liv
import LiveChannelsVerticalContents from "./LiveChannelsVerticalContents/LiveChannelsVerticalContents";
import NoLiveContents from "./NoLiveContents/NoLiveContents";
// import { useDispatch } from "react-redux";
// import { getBrandLiveChannelInfo } from "../../../actions/brandActions";
// import { getBrandChanInfo } from "../../../actions/brandActions";
const Container = SpotlightContainerDecorator(
{ leaveFor: { right: "" }, enterTo: "default-element" },
@@ -49,12 +49,11 @@ export default memo(function LiveChannels({
// interval = setInterval(
// () =>
// dispatch(
// getBrandLiveChannelInfo({
// getBrandChanInfo({
// patnrId: selectedPatnrId,
// noLoading: true,
// })
// ),
// 10000
// 30000
// );
// return () => clearInterval(interval);