김건희

[Update] Login, Register Files

......@@ -63,7 +63,7 @@ function LoginPage(props) {
dispatch(login(UserData))
.then(res => {
if (res.payload.logged) {
if (res.payload.loginSuccess) {
props.history.push('/register');
} else {
alert(res.payload.error);
......
......@@ -31,13 +31,13 @@ export function login(data) {
}
};
export default function (state = InitialState, action) {
export default function (state = {}, action) {
switch (action.type) {
case REGISTER:
return {...state, register: action.payload};
return {...state, success: action.payload};
break;
case LOGIN:
return {...state, logged: action.payload};
return {...state, loginSuccess: action.payload};
break;
default:
return state;
......