render power data in table format

This commit is contained in:
Eric Hulburd
2016-02-10 16:11:56 -06:00
parent b14c266de3
commit 9996dfc54e
26 changed files with 424 additions and 141 deletions

View File

@@ -5,10 +5,8 @@ const NAME = 'EnergyController';
class EnergyController{
static index(req, res){
DB.House.findOne({where: {name: req.housename}}).then((house)=>{
house.getEnergyDataByTime(req.params.start_time, req.params.end_time).then((energy_data)=>{
req.json(energy_data);
});
DB.EnergyDatum.exposeForHouseAtDates(req.query.house_id, req.query.dates).then((energy_data)=>{
req.json({data: energy_data});
});
}