diff --git a/src/containers/account/mypage/AccountMypageContainer.js b/src/containers/account/mypage/AccountMypageContainer.js index ef42862..98e94b1 100644 --- a/src/containers/account/mypage/AccountMypageContainer.js +++ b/src/containers/account/mypage/AccountMypageContainer.js @@ -321,13 +321,13 @@ const AccountMypageContainer = () => { const waitwait = () => { dispatch(userDeleteAction.request(user.cstmrSno)); // alert('아직 탈퇴 못해용~'); - setModal({ - isOpen: true, - title: '탈퇴 확인', - desc: '탈퇴가 완료되었습니다.', - color: 'primary' - }); - return; + // setModal({ + // isOpen: true, + // title: '탈퇴 확인', + // desc: '탈퇴가 완료되었습니다.', + // color: 'primary' + // }); + // return; }; return ( diff --git a/src/modules/account/login/actions/authAction.ts b/src/modules/account/login/actions/authAction.ts index 7e3ae40..1d926c4 100644 --- a/src/modules/account/login/actions/authAction.ts +++ b/src/modules/account/login/actions/authAction.ts @@ -72,7 +72,7 @@ export const userDeleteAction = createAsyncAction( USERS_DELETE_REQUEST, USERS_DELETE_SUCCESS, USERS_DELETE_FAILURE -)(); +)(); export const pwUpdateAction = createAsyncAction( USERS_PWUPDATE_REQUEST, diff --git a/src/modules/account/login/reducers/authReducer.ts b/src/modules/account/login/reducers/authReducer.ts index 11400c4..2b8b7da 100644 --- a/src/modules/account/login/reducers/authReducer.ts +++ b/src/modules/account/login/reducers/authReducer.ts @@ -12,6 +12,7 @@ import { logout, refresh, pwUpdateAction, + userDeleteAction } from '../actions/authAction'; import { UserPageState, UserPageData, initResponseUserPageData,UserPwState,UserData,UserPw,initResponseUserPwPageData,} from '../models/authModel'; @@ -23,6 +24,7 @@ export interface AuthState { message: string; user?: UserData; UserPw?: UserPw; + } // reducers @@ -78,8 +80,13 @@ export const authReducer = createReducer(initialState) draft.isLogin = false; draft.user = undefined; }) + ) + .handleAction(userDeleteAction.success, state => + produce(state, draft => { + draft.isLogin = false; + draft.user = undefined; + }) ); - export const mypageReducer = createReducer(initResponseUserPageData).handleAction(userPageAction.success, (state, action) => produce(state, draft => { const data: UserPageData = action.payload; diff --git a/src/modules/account/login/sagas/authSaga.ts b/src/modules/account/login/sagas/authSaga.ts index 88dd1b0..057379e 100644 --- a/src/modules/account/login/sagas/authSaga.ts +++ b/src/modules/account/login/sagas/authSaga.ts @@ -158,10 +158,38 @@ function* userDeletePageSaga( const { data } = yield call(authAPI.deletedata, controlId); // console.log('userPageData : ', data) + console.log("sdsdsd",data) + if (data.errorCode === '-1') { + yield put( + MessageActions.IS_ERROR({ + errorCode: ERROR_MESSAGE.code, + errorMessage: ERROR_MESSAGE.message, + isHistoryBack: false, + isRefresh: false + }) + ); yield put(Actions.userDeleteAction.success(data)); - } catch (error) { - yield put(Actions.userDeleteAction.failure(error)); + } else { + yield put( + MessageActions.IS_MESSAGE({ + messageCode: SAVE_MESSAGE.code, + message: SAVE_MESSAGE.message, + isHistoryBack: false, + isRefresh: true + }) + ); + } +} catch (error) { + yield put( + MessageActions.IS_ERROR({ + errorCode: ERROR_MESSAGE.code, + errorMessage: '처리 중 에러입니다.', + isHistoryBack: false, + isRefresh: false + }) + ); +} } function* userUpdateSaga( action: ActionType