import * as types from "../actionTypes/actionTypes";

const initialState = {
    user: {}
}

export default (state = initialState, action) => {
    switch (action.type) {
        case types.POST_REQUEST_LOGIN: {
            return state;
        }

        case types.POST_REQUEST_SUCCESS_LOGIN: {   
            //console.log('action.payload.user',action.payload.user);
            return {
                ...state,
                user: action.payload.user
            };
        }

        case types.POST_REQUEST_ERROR_LOGIN: {
            console.log('error', action.payload.message);
            return state;
        }

        default:
            return state;
    }
}