redux-toolkit -> redux 마이그레이션 및 TAxios 로직 수정
This commit is contained in:
32
com.twin.app.shoptime/src/actions/onSaleActions.js
Normal file
32
com.twin.app.shoptime/src/actions/onSaleActions.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { URLS } from "../api/apiConfig";
|
||||
import { TAxios } from "../api/TAxios";
|
||||
import { types } from "./actionTypes";
|
||||
|
||||
// On Sale 조회 IF-LGSP-086
|
||||
export const getOnSaleInfo = (props) => (dispatch, getState) => {
|
||||
const { categoryIncFlag, lgCatCd } = props;
|
||||
|
||||
const onSuccess = (response) => {
|
||||
console.log("getOnSaleInfo onSuccess ", response.data);
|
||||
|
||||
dispatch({
|
||||
type: types.GET_ON_SALE_INFO,
|
||||
payload: response.data.data,
|
||||
});
|
||||
};
|
||||
|
||||
const onFail = (error) => {
|
||||
console.error("getOnSaleInfo onFail", error);
|
||||
};
|
||||
|
||||
TAxios(
|
||||
dispatch,
|
||||
getState,
|
||||
"get",
|
||||
URLS.GET_ON_SALE_INFO,
|
||||
{ categoryIncFlag, lgCatCd },
|
||||
{},
|
||||
onSuccess,
|
||||
onFail
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user