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

const initialState = {
    events: []
}

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

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

        case types.GET_REQUEST_ERROR_EVENTS: {
            console.log('error events');
            return state;
        }

        default:
            return state;
    }
}