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

const initialState = {
    reviews: []
}

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

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

        case types.GET_REQUEST_ERROR_REVIEWS: {
            console.log('error reviews');
            return state;
        }

        case types.POST_REQUEST_REVIEW: {
            return state;
        }

        case types.POST_REQUEST_SUCCESS_REVIEW: {
            return state;
        }

        case types.POST_REQUEST_ERROR_REVIEW: {
            console.log('error reviews');
            return state;
        }

        default:
            return state;
    }
}