import actionTypes from '../actiontype/replenish';


const setErrorInfo = (state,errorInfo)=>{
    return Object.assign({},state,{errorInfo});
};
const emptyErrorInfo = (state)=>{
    return Object.assign({},state,{errorInfo:null})
}

export default function(state={}, action) {
    switch (action.type) {
        case actionTypes.SETREPLENISHERRORINFO:
            return setErrorInfo(state,action.errorInfo);
        case actionTypes.EMPTYREPLENISHERRORINFO :
            return emptyErrorInfo(state);
        default:
            return state;
    }
}