const FUELS_CREATE_REQUEST = "FUELS_CREATE_REQUEST";
const FUELS_CREATE_SUCCESS = "FUELS_CREATE_SUCCESS";
const FUELS_CREATE_ERROR = "FUELS_CREATE_ERROR";
  
const initialState = {
	data: [],
	createRequestPending: false
}
  
const fuelsCreateReducer = (state = initialState, { type, payload }) => {
	switch(type) {
		case FUELS_CREATE_REQUEST:
			return {
				...state,
				createRequestPending: true
			};
		case FUELS_CREATE_SUCCESS:
			return {
				...state,
				data: payload.data,
				createRequestPending: false
			};
		case FUELS_CREATE_ERROR:
			return {
				...state,
        createRequestPending: false,
        data: payload.data
      };      
		default:
			return state;
  }
};
  
  export default fuelsCreateReducer;