[order-controller]
1. Checkout 관련 api 추가 (구매 약간 동의, 철회) [App.js] 1. getHomeTerms - mbrNo 파라미터 추가
This commit is contained in:
68
com.twin.app.shoptime/src/actions/orderActions.js
Normal file
68
com.twin.app.shoptime/src/actions/orderActions.js
Normal file
@@ -0,0 +1,68 @@
|
||||
import { URLS } from "../api/apiConfig";
|
||||
import { TAxios } from "../api/TAxios";
|
||||
import { types } from "./actionTypes";
|
||||
import { getTermsAgreeYn } from "./commonActions";
|
||||
|
||||
// 구매 약관 동의 (IF-LGSP-360)
|
||||
export const setPurchaseTermsAgree = (params) => (dispatch, getState) => {
|
||||
const { mbrNo, termsList } = params;
|
||||
|
||||
const onSuccess = (response) => {
|
||||
console.log("setPurchaseTermsAgree onSuccess ", response.data);
|
||||
|
||||
dispatch({
|
||||
type: types.SET_PURCHASE_TERMS_AGREE,
|
||||
payload: response.data.data,
|
||||
retCode: response.data.retCode,
|
||||
});
|
||||
|
||||
dispatch(getTermsAgreeYn());
|
||||
};
|
||||
|
||||
const onFail = (error) => {
|
||||
console.error("setPurchaseTermsAgree onFail ", error);
|
||||
};
|
||||
|
||||
TAxios(
|
||||
dispatch,
|
||||
getState,
|
||||
"post",
|
||||
URLS.SET_PURCHASE_TERMS_AGREE,
|
||||
{},
|
||||
{ mbrNo, termsList },
|
||||
onSuccess,
|
||||
onFail
|
||||
);
|
||||
};
|
||||
|
||||
// 구매 약관 철회 (IF-LGSP-361)
|
||||
export const setPurchasetermsWithdraw = (params) => (dispatch, getState) => {
|
||||
const { mbrNo, termsList } = params;
|
||||
|
||||
const onSuccess = (response) => {
|
||||
console.log("setPurchasetermsWithdraw onSuccess ", response.data);
|
||||
|
||||
dispatch({
|
||||
type: types.SET_PURCHASE_TERMS_WITHDRAW,
|
||||
payload: response.data.data,
|
||||
retCode: response.data.retCode,
|
||||
});
|
||||
|
||||
dispatch(getTermsAgreeYn());
|
||||
};
|
||||
|
||||
const onFail = (error) => {
|
||||
console.error("setPurchasetermsWithdraw onFail ", error);
|
||||
};
|
||||
|
||||
TAxios(
|
||||
dispatch,
|
||||
getState,
|
||||
"post",
|
||||
URLS.SET_PURCHASE_TERMS_WITHDRAW,
|
||||
{},
|
||||
{ mbrNo, termsList },
|
||||
onSuccess,
|
||||
onFail
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user