[장바구니 담기 에러 수정]
- 장바구니 담는부분에서 배열로 옵션을 넣어야한다하여 변경처리. - cartaction에서 정상적으로 안들어왔을때는 에러노출되도록 변경.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { URLS } from '../api/apiConfig';
|
||||
import { TAxios } from '../api/TAxios';
|
||||
import { types } from './actionTypes';
|
||||
import { showError } from './commonActions';
|
||||
|
||||
/**
|
||||
* 회원 장바구니 정보 조회
|
||||
@@ -57,24 +58,33 @@ export const insertMyinfoCart = (props) => (dispatch, getState) => {
|
||||
const { mbrNo, patnrId, prdtId, prdtOpt, prodQty } = props;
|
||||
|
||||
const onSuccess = (response) => {
|
||||
console.log("✅ insertMyinfoCart API 성공:", response.data);
|
||||
if (response.data.retCode !== '0' && response.data.retCode !== 0) {
|
||||
console.error("❌ retCode 에러:", response.data.retCode);
|
||||
console.error("에러 메시지:", response.data.retMsg);
|
||||
console.log("✅ insertMyinfoCart API 성공:", response.data.retCode);
|
||||
// if (response.data?.retCode !== '0' && response.data.retCode !== 0) {
|
||||
// console.error("❌ retCode 에러:", response.data.retCode);
|
||||
// console.error("에러 메시지:", response.data.retMsg);
|
||||
|
||||
return;
|
||||
}
|
||||
// response.data.data가 실제 상품 정보인지 확인
|
||||
if (!response.data.data) {
|
||||
console.warn("⚠️ response.data.data가 undefined입니다");
|
||||
}
|
||||
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (response.data.retCode === 0) {
|
||||
dispatch({
|
||||
type: types.INSERT_MY_INFO_CART,
|
||||
payload: response.data.data,
|
||||
});
|
||||
|
||||
dispatch(getMyInfoCartSearch({ mbrNo }));
|
||||
});
|
||||
dispatch(getMyInfoCartSearch({ mbrNo }));
|
||||
} else {
|
||||
dispatch(
|
||||
showError(
|
||||
response.data.retCode,
|
||||
response.data.retMsg,
|
||||
false,
|
||||
null,
|
||||
null
|
||||
)
|
||||
);
|
||||
console.error("❌ retCode 에러:", response.data.retCode);
|
||||
console.error("에러 메시지:", response.data.retMsg);
|
||||
}
|
||||
};
|
||||
|
||||
const onFail = (error) => {
|
||||
|
||||
Reference in New Issue
Block a user