[order-controller]

1.  Checkout 관련 api 추가 (구매 약간 동의, 철회)

[App.js]
1. getHomeTerms - mbrNo 파라미터 추가
This commit is contained in:
hyunwoo93.cha
2024-04-02 13:35:53 +09:00
parent 7b9b7d011c
commit 73bd4d65f8
5 changed files with 86 additions and 6 deletions

View File

@@ -154,6 +154,7 @@ function AppBase(props) {
dispatch(getAuthenticationCode());
dispatch(
getHomeTerms({
mbrNo: appStatus.loginUserData.userInfo,
trmsTpCdList: "MST00401, MST00402, MST00403, MST00404",
})
);

View File

@@ -109,4 +109,8 @@ export const types = {
// checkout actions
GET_CHECKOUT_INFO: "GET_CHECKOUT_INFO",
// order actions
SET_PURCHASE_TERMS_AGREE: "SET_PURCHASE_TERMS_AGREE",
SET_PURCHASE_TERMS_WITHDRAW: "SET_PURCHASE_TERMS_WITHDRAW",
};

View 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
);
};

View File

@@ -95,6 +95,10 @@ export const URLS = {
// app controller
SEND_SMS: "/lgsp/v1/app/sms.lge",
// order controller
SET_PURCHASE_TERMS_AGREE: "/lgsp/v1/myinfo/purchaseTerms/agree.lge",
SET_PURCHASE_TERMS_WITHDRAW: "/lgsp/v1/myinfo/purchaseTerms/withdraw.lge",
};
const getRicCode = (country, ricCodeSetting) => {

View File

@@ -21,7 +21,7 @@ const initialState = {
},
termsFlag: null,
introTermsAgree: undefined,
checkoutTermsAgree: false,
checkoutTermsAgree: undefined,
};
export const commonReducer = (state = initialState, action) => {
@@ -108,16 +108,19 @@ export const commonReducer = (state = initialState, action) => {
};
}
case types.REGISTER_DEVICE: {
if(action.payload && action.payload.dvcIndex){
if (action.payload && action.payload.dvcIndex) {
return {
...state,
termsFlag: {...state.termsFlag, privacyTerms: "Y", serviceTerms: "Y"},
introTermsAgree: true
termsFlag: {
...state.termsFlag,
privacyTerms: "Y",
serviceTerms: "Y",
},
introTermsAgree: true,
};
}else{
} else {
return state;
}
}
default: