diff --git a/com.twin.app.shoptime/src/App/App.js b/com.twin.app.shoptime/src/App/App.js index e86033bc..20934604 100644 --- a/com.twin.app.shoptime/src/App/App.js +++ b/com.twin.app.shoptime/src/App/App.js @@ -6,10 +6,14 @@ import ThemeDecorator from "@enact/sandstone/ThemeDecorator"; import { getBrandList } from "../features/brand/brandsSlice"; import { getAuthenticationCode } from "../features/device/deviceSlice"; -import { getHomeMenu, getHomeLayout, getHomeMainContents } from "../features/home/homeSlice"; +import { + getHomeMenu, + getHomeLayout, + getHomeMainContents, +} from "../features/home/homeSlice"; import { getMyRecommandedKeyword } from "../features/mypage/myPageSlice"; import { getOnSaleInfo } from "../features/onSale/onSaleSlice"; -import { getSubCategory } from "../features/main/mainSlice"; +import { getSubCategory, getTop20Show } from "../features/main/mainSlice"; import { getBestSeller } from "../features/product/productSlice"; import MainView from "../views/MainView/MainView"; import css from "./App.module.less"; @@ -35,6 +39,7 @@ function AppBase(props) { filterType: "", }) ); + dispatch(getTop20Show()); }, [dispatch]); return ; diff --git a/com.twin.app.shoptime/src/api/apiConfig.js b/com.twin.app.shoptime/src/api/apiConfig.js index 1cd2696d..c61b2a72 100644 --- a/com.twin.app.shoptime/src/api/apiConfig.js +++ b/com.twin.app.shoptime/src/api/apiConfig.js @@ -41,6 +41,7 @@ export const URLS = { //main controller GET_SUB_CATEGORY: "/lgsp/v1/main/subcategory.lge", + GET_TOP20_SHOW: "/lgsp/v1/main/top/show.lge", }; export const getUrl = (endStr) => { diff --git a/com.twin.app.shoptime/src/features/main/mainSlice.js b/com.twin.app.shoptime/src/features/main/mainSlice.js index fc43af1e..8e151450 100644 --- a/com.twin.app.shoptime/src/features/main/mainSlice.js +++ b/com.twin.app.shoptime/src/features/main/mainSlice.js @@ -35,6 +35,35 @@ export const getSubCategory = createAsyncThunk( } ); +//메인화면 Live Show 정보 조회 +export const getTop20Show = createAsyncThunk( + "main/getTop20Show", + + async (_, thunkAPI) => { + const onSuccess = (response) => { + console.log("getTop20Show onSuccess ", response.data); + + thunkAPI.dispatch( + mainSlice.actions.updateSubCategoryData(response.data.data) + ); + }; + const onFail = (error) => { + console.log("getTop20Show onFail", error); + }; + + TAxios( + thunkAPI.dispatch, + thunkAPI.getState, + "get", + URLS.GET_TOP20_SHOW, + {}, + {}, + onSuccess, + onFail + ); + } +); + const initialState = { subCategoryData: {}, }; @@ -46,9 +75,12 @@ export const mainSlice = createSlice({ updateSubCategoryData: (state, action) => { state.subCategoryData = action.payload; }, + updateTop20Show: (state, action) => { + state.top20ShowData = action.payload; + }, }, }); -export const { updateSubCategoryData } = mainSlice.actions; +export const { updateSubCategoryData, updateTop20Show } = mainSlice.actions; export default mainSlice.reducer;