import * as actionTypes from './../../constants/user'; import initialState from './../initialState'; export default function chageLoginReducer(state = initialState.changeLogin, { type, payload }) { switch (type) { case actionTypes.CHANGE_LOGIN_REQUEST: { console.log(payload) return { ...state, isFetching: true, payload } } case actionTypes.CHANGE_LOGIN_REQUEST_SUCCESS: { const { name } = payload; return { ...state, isFetching: false, data:name } } case actionTypes.CHANGE_LOGIN_REQUEST_FAILURE: { const { error } = payload; return { ...state, isFetching: false, error } } default: { return state; } } }