fix problems with rendering data
This commit is contained in:
@@ -7,7 +7,7 @@ class HousesController {
|
||||
static index(req, res){
|
||||
var params = {};
|
||||
if (req.query.ids) query.id = ids;
|
||||
DB.House.findAll({where: params, attributes: ['id', 'name', 'timezone']}).then((houses)=>{
|
||||
DB.House.findAll({where: params}).then((houses)=>{
|
||||
res.json({data: houses.map((house)=>{ return house.dataValues; })});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ const NAME = 'PowerController';
|
||||
class PowerController{
|
||||
|
||||
static index(req, res){
|
||||
console.log(req.query);
|
||||
DB.PowerDatum.exposeForHouseAtDates(req.query.house_id, req.query.dates).then((power_data)=>{
|
||||
res.json({data: power_data});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user