diff --git a/src/containers/account/mypage/AccountMypageContainer.js b/src/containers/account/mypage/AccountMypageContainer.js index 98e94b1..56c97e9 100644 --- a/src/containers/account/mypage/AccountMypageContainer.js +++ b/src/containers/account/mypage/AccountMypageContainer.js @@ -320,7 +320,6 @@ const AccountMypageContainer = () => { const waitwait = () => { dispatch(userDeleteAction.request(user.cstmrSno)); - // alert('아직 탈퇴 못해용~'); // setModal({ // isOpen: true, // title: '탈퇴 확인', diff --git a/src/modules/account/login/sagas/authSaga.ts b/src/modules/account/login/sagas/authSaga.ts index 606ba5d..19d14dd 100644 --- a/src/modules/account/login/sagas/authSaga.ts +++ b/src/modules/account/login/sagas/authSaga.ts @@ -153,72 +153,28 @@ function* userPageSaga( function* userDeletePageSaga( action: ActionType ) { - // try { - // const controlId = action.payload; - - // const { data } = yield call(authAPI.deletedata, controlId); - // // console.log('userPageData : ', 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)); - // } else { - // yield put( - // MessageActions.IS_MESSAGE({ - // messageCode: SAVE_MESSAGE.code, - // message: SAVE_MESSAGE.message, - // isHistoryBack: false, - // isRefresh: false - // }) - // ); - // cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - // cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); - - // yield put(replace('/')); - // } - // } catch (error) { - // yield put( - // MessageActions.IS_ERROR({ - // errorCode: ERROR_MESSAGE.code, - // errorMessage: '처리 중 에러입니다.', - // isHistoryBack: false, - // isRefresh: false - // }) - // ); - // } - // } - const accessToken = cookieStorage.getCookie(COOKIE_ACCESS_TOKEN); - //console.log('accessToken', accessToken); - try { - const controlId = action.payload; - // console.log('dddddddddddddddddddddddddddddddddddd'); - const { data } = yield call(authAPI.deletedata, controlId); + const controlId = action.payload; + // console.log('dddddddddddddddddddddddddddddddddddd'); + const { data } = yield call(authAPI.deletedata, controlId); + if (data.result === true) { + yield put( + MessageActions.IS_MESSAGE({ + messageCode: SAVE_MESSAGE.code, + message: SAVE_MESSAGE.message, + isHistoryBack: false, + isRefresh: true + }) + ); + //location.href = '/account/login'; + cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); + cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); - if (data.result === true) { - yield put( - MessageActions.IS_MESSAGE({ - messageCode: SAVE_MESSAGE.code, - message: SAVE_MESSAGE.message, - isHistoryBack: false, - isRefresh: false - }) - ); - location.href = '/account/login'; - // yield put(Actions.userDeleteAction.success(data));; - } - - // yield put(Actions.logout.success()); - cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); + yield put(replace('/')); + // yield put(Actions.userDeleteAction.success(data));; + } - yield put(replace('/')); + // yield put(Actions.logout.success()); } catch (error) { yield put(Actions.logout.failure(error)); } @@ -245,13 +201,9 @@ function* userUpdateSaga( messageCode: SAVE_MESSAGE.code, message: SAVE_MESSAGE.message, isHistoryBack: false, - isRefresh: true + isRefresh: false }) ); - cookieStorage.removeCookie(COOKIE_ACCESS_TOKEN); - cookieStorage.removeCookie(COOKIE_REFRESH_TOKEN); - - yield put(replace('/')); } } catch (error) { yield put(