const STATION_CREATE_REQUEST = "STATION_CREATE_REQUEST";
const STATION_CREATE_SUCCESS = "STATION_CREATE_SUCCESS";
const STATION_CREATE_ERROR = "STATION_CREATE_ERROR";
  
const initialState = {
	data: [],
	createRequestPending: false
}
  
const stationCreateReducer = (state = initialState, { type, payload }) => {
	switch(type) {
		case STATION_CREATE_REQUEST:
			return {
				...state,
				createRequestPending: true
			};
		case STATION_CREATE_SUCCESS:
			return {
				...state,
				data: payload.data,
				createRequestPending: false
			};
		case STATION_CREATE_ERROR:
			return {
				...state,
				createRequestPending: false
			};
		default:
			return state;
	}
};
  
  export default stationCreateReducer;