Files
old-spike/client/api/energy_data.js

20 lines
321 B
JavaScript
Raw Normal View History

2016-02-09 19:17:05 -06:00
import extend from 'extend';
2016-02-10 16:11:56 -06:00
const ENDPOINT = '/data/v1/energy';
2016-02-09 19:17:05 -06:00
class EnergyDataApi {
static index(params){
2016-02-09 19:17:05 -06:00
return jQuery.ajax({
2016-02-10 16:11:56 -06:00
url: ENDPOINT + '?' + jQuery.param(params),
2016-02-09 19:17:05 -06:00
type: 'GET',
dataType: 'json'
2016-02-10 16:11:56 -06:00
}).then((res)=>{
2016-02-09 19:17:05 -06:00
return res.data;
});
}
}
export default EnergyDataApi;