[FeaturedBrandsPanel] logic 수정

1. loading panel 반영, logic 수정
2. brandActions, brandReducer 일부 수정
3. SeriesImageCard, fix warning
4. ShowroomNavItem, label 변수 상단 이동
This commit is contained in:
younghoon100.park
2024-06-02 19:41:41 +09:00
parent 2e14e7c631
commit 6aa6a16ba8
5 changed files with 40 additions and 199 deletions

View File

@@ -1,17 +1,10 @@
import { URLS } from "../api/apiConfig";
import { TAxios } from "../api/TAxios";
import { types } from "./actionTypes";
import { changeAppStatus } from "./commonActions";
// Featured Brands 정보 조회 IF-LGSP-304
export const getBrandList = () => (dispatch, getState) => {
dispatch({
type: types.GET_BRAND_LIST,
payload: {
...getState().brand.brandInfoData,
status: "pending",
},
});
const onSuccess = (response) => {
// console.log("getBrandList onSuccess ", response.data);
@@ -19,7 +12,6 @@ export const getBrandList = () => (dispatch, getState) => {
type: types.GET_BRAND_LIST,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
@@ -44,14 +36,6 @@ export const getBrandList = () => (dispatch, getState) => {
export const getBrandLayoutInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch({
type: types.GET_BRAND_LAYOUT_INFO,
payload: {
...getState().brand.brandLayoutInfoData,
status: "pending",
},
});
const onSuccess = (response) => {
// console.log("getBrandLayoutInfo onSuccess ", response.data);
@@ -59,7 +43,6 @@ export const getBrandLayoutInfo = (props) => (dispatch, getState) => {
type: types.GET_BRAND_LAYOUT_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
@@ -84,27 +67,25 @@ export const getBrandLayoutInfo = (props) => (dispatch, getState) => {
export const getBrandLiveChannelInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch({
type: types.GET_BRAND_LIVE_CHANNEL_INFO,
payload: {
...getState().brand.brandLiveChannelInfoData,
status: "pending",
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
const onSuccess = (response) => {
// console.log("getBrandLiveChannelInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_LIVE_CHANNEL_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
console.error("getBrandLiveChannelInfo onFail ", error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
@@ -124,11 +105,11 @@ export const getBrandChanInfo = (props) => (dispatch, getState) => {
const onSuccess = (response) => {
// console.log("getBrandChanInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CHAN_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
@@ -153,14 +134,6 @@ export const getBrandChanInfo = (props) => (dispatch, getState) => {
export const getBrandTSVInfo = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch({
type: types.GET_BRAND_TSV_INFO,
payload: {
...getState().brand.brandTsvInfoData,
status: "pending",
},
});
const onSuccess = (response) => {
// console.log("getBrandTSVInfo onSuccess ", response.data);
@@ -168,7 +141,6 @@ export const getBrandTSVInfo = (props) => (dispatch, getState) => {
type: types.GET_BRAND_TSV_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
@@ -193,13 +165,7 @@ export const getBrandTSVInfo = (props) => (dispatch, getState) => {
export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
const { catCd, patnrId } = props;
dispatch({
type: types.GET_BRAND_RECOMMENDED_SHOW_INFO,
payload: {
...getState().brand.brandRecommendedShowInfoData,
status: "pending",
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
const onSuccess = (response) => {
// console.log("getBrandRecommendedShowInfo onSuccess", response.data);
@@ -208,13 +174,16 @@ export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
type: types.GET_BRAND_RECOMMENDED_SHOW_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
console.error("getBrandRecommendedShowInfo onFail", error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
@@ -233,13 +202,7 @@ export const getBrandRecommendedShowInfo = (props) => (dispatch, getState) => {
export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
const { hstNm, patnrId } = props;
dispatch({
type: types.GET_BRAND_CREATORS_INFO,
payload: {
...getState().brand.brandCreatorsInfoData,
status: "pending",
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: true, type: "wait" } }));
const onSuccess = (response) => {
// console.log("getBrandCreatorsInfo onSuccess ", response.data);
@@ -248,13 +211,16 @@ export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
type: types.GET_BRAND_CREATORS_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
const onFail = (error) => {
console.error("getBrandCreatorsInfo onFail ", error);
dispatch(changeAppStatus({ showLoadingPanel: { show: false } }));
};
TAxios(
@@ -273,14 +239,6 @@ export const getBrandCreatorsInfo = (props) => (dispatch, getState) => {
export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
const { patnrId, seriesId } = props;
dispatch({
type: types.GET_BRAND_SERIES_INFO,
payload: {
...getState().brand.brandSeriesInfoData,
status: "pending",
},
});
const onSuccess = (response) => {
// console.log("getBrandSeriesInfo onSuccess ", response.data);
@@ -288,7 +246,6 @@ export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
type: types.GET_BRAND_SERIES_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
@@ -313,22 +270,11 @@ export const getBrandSeriesInfo = (props) => (dispatch, getState) => {
export const getBrandCategoryInfo = (props) => (dispatch, getState) => {
const { catCdLv1, catCdLv2, patnrId } = props;
// dispatch({
// type: types.GET_BRAND_CATEGORY_INFO,
// payload: {
// ...getState().brand.brandCategoryInfoData,
// status: "pending",
// },
// });
const onSuccess = (response) => {
// console.log("getBrandCategoryInfo onSuccess ", response.data);
dispatch({
type: types.GET_BRAND_CATEGORY_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
@@ -352,14 +298,6 @@ export const getBrandCategoryInfo = (props) => (dispatch, getState) => {
export const getBrandCategoryProductInfo = (props) => (dispatch, getState) => {
const { catCdLv1, catCdLv2, patnrId } = props;
// dispatch({
// type: "GET_BRAND_CATEGORY_PRODUCT_INFO",
// payload: {
// ...getState().brand.brandCategoryInfoData,
// status: "pending",
// },
// });
const onSuccess = (response) => {
// console.log("getBrandCategoryProductInfo onSuccess ", response.data);
@@ -367,7 +305,6 @@ export const getBrandCategoryProductInfo = (props) => (dispatch, getState) => {
type: types.GET_BRAND_CATEGORY_PRODUCT_INFO,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
@@ -392,14 +329,6 @@ export const getBrandCategoryProductInfo = (props) => (dispatch, getState) => {
export const getBrandBestSeller = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch({
type: types.GET_BRAND_BEST_SELLER,
payload: {
...getState().brand.brandBestSellerData,
status: "pending",
},
});
const onSuccess = (response) => {
// console.log("getBrandBestSeller onSuccess ", response.data);
@@ -407,7 +336,6 @@ export const getBrandBestSeller = (props) => (dispatch, getState) => {
type: types.GET_BRAND_BEST_SELLER,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};
@@ -432,14 +360,6 @@ export const getBrandBestSeller = (props) => (dispatch, getState) => {
export const getBrandShowroom = (props) => (dispatch, getState) => {
const { patnrId } = props;
dispatch({
type: types.GET_BRAND_SHOWROOM,
payload: {
...getState().brand.brandShowroomData,
status: "pending",
},
});
const onSuccess = (response) => {
// console.log("getBrandShowroom onSuccess ", response.data);
@@ -447,7 +367,6 @@ export const getBrandShowroom = (props) => (dispatch, getState) => {
type: types.GET_BRAND_SHOWROOM,
payload: {
data: response.data.data,
status: "fulfilled",
},
});
};