[API] 테마 큐레이션 추가
Detail Notes : 1. Hot Picks 작업을 위한 api 추가
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
getHomeMenu,
|
||||
getHomeLayout,
|
||||
getHomeMainContents,
|
||||
getThemeCurationInfo,
|
||||
} from "../features/home/homeSlice";
|
||||
import { getMyRecommandedKeyword } from "../features/mypage/myPageSlice";
|
||||
import { getOnSaleInfo } from "../features/onSale/onSaleSlice";
|
||||
@@ -40,6 +41,7 @@ function AppBase(props) {
|
||||
})
|
||||
);
|
||||
dispatch(getTop20Show());
|
||||
dispatch(getThemeCurationInfo());
|
||||
}, [dispatch]);
|
||||
|
||||
return <MainView />;
|
||||
|
||||
@@ -15,6 +15,7 @@ export const URLS = {
|
||||
GET_HOME_MENU: "/lgsp/v1/home/menu.lge",
|
||||
GET_HOME_LAYOUT: "/lgsp/v1/home/homeLayout.lge",
|
||||
GET_HOME_MAIN_CONTENTS: "/lgsp/v1/home/homeContentsInfo.lge",
|
||||
GET_THEME_CURATION_INFO: "/lgsp/v2/home/theme/curations.lge",
|
||||
|
||||
//brand-controller
|
||||
GET_BRAND_LIST: "/lgsp/v1/brand/info.lge",
|
||||
|
||||
@@ -116,11 +116,40 @@ export const getHomeMainContents = createAsyncThunk(
|
||||
}
|
||||
);
|
||||
|
||||
// Theme 전시 정보 조회 : IF-LGSP-045
|
||||
export const getThemeCurationInfo = createAsyncThunk(
|
||||
"home/getThemeCurationInfo",
|
||||
|
||||
async (_, thunkAPI) => {
|
||||
const onSuccess = (response) => {
|
||||
console.log("getThemeCurationInfo onSuccess", response.data);
|
||||
|
||||
thunkAPI.dispatch(homeSlice.actions.updateThemeCurationInfoDataData(response.data.data));
|
||||
};
|
||||
|
||||
const onFail = (error) => {
|
||||
console.error("getThemeCurationInfo onFail", error);
|
||||
};
|
||||
|
||||
TAxios(
|
||||
thunkAPI.dispatch,
|
||||
thunkAPI.getState,
|
||||
"get",
|
||||
URLS.GET_THEME_CURATION_INFO,
|
||||
{},
|
||||
{},
|
||||
onSuccess,
|
||||
onFail
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
const initialState = {
|
||||
termsData: {},
|
||||
menuData: {},
|
||||
layoutData: {},
|
||||
mainContentsData: {}
|
||||
mainContentsData: {},
|
||||
themeCurationInfoData: {},
|
||||
};
|
||||
|
||||
export const homeSlice = createSlice({
|
||||
@@ -139,10 +168,19 @@ export const homeSlice = createSlice({
|
||||
},
|
||||
updateMainContentsData: (state, action) => {
|
||||
state.mainContentsData = action.payload;
|
||||
}
|
||||
},
|
||||
updateThemeCurationInfoDataData: (state, action) => {
|
||||
state.themeCurationInfoData = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { updateTermsData, updateMenuData, updateLayoutData, updateMainContentsData } = homeSlice.actions;
|
||||
export const {
|
||||
updateTermsData,
|
||||
updateMenuData,
|
||||
updateLayoutData,
|
||||
updateMainContentsData,
|
||||
updateThemeCurationInfoDataData,
|
||||
} = homeSlice.actions;
|
||||
|
||||
export default homeSlice.reducer;
|
||||
export default homeSlice.reducer;
|
||||
|
||||
Reference in New Issue
Block a user