Browse Source

회원탈퇴 문구 수정

pull/2/head
sanguu 2 years ago
parent
commit
cfad9d66ce
  1. 14
      src/containers/account/mypage/AccountMypageContainer.js
  2. 2
      src/modules/account/login/actions/authAction.ts
  3. 9
      src/modules/account/login/reducers/authReducer.ts
  4. 32
      src/modules/account/login/sagas/authSaga.ts

14
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 (

2
src/modules/account/login/actions/authAction.ts

@ -72,7 +72,7 @@ export const userDeleteAction = createAsyncAction(
USERS_DELETE_REQUEST,
USERS_DELETE_SUCCESS,
USERS_DELETE_FAILURE
)<string, UserPageData, AxiosError>();
)<string, void, AxiosError>();
export const pwUpdateAction = createAsyncAction(
USERS_PWUPDATE_REQUEST,

9
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<AuthState, AuthAction>(initialState)
draft.isLogin = false;
draft.user = undefined;
})
)
.handleAction(userDeleteAction.success, state =>
produce(state, draft => {
draft.isLogin = false;
draft.user = undefined;
})
);
export const mypageReducer = createReducer<UserPageState, AuthAction>(initResponseUserPageData).handleAction(userPageAction.success, (state, action) =>
produce(state, draft => {
const data: UserPageData = action.payload;

32
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<typeof Actions.userupdateAction.request>

Loading…
Cancel
Save