Skip to content
Snippets Groups Projects
Commit ee307b29 authored by Diego Giovane Pasqualin's avatar Diego Giovane Pasqualin
Browse files

charts.js: Fix sending wrong params to query

parent 4b152924
No related branches found
No related tags found
No related merge requests found
......@@ -68,12 +68,11 @@ exports.get_data = function(req, res) {
for (var i=0; i<queries.length; i++) {
var query = queries[i];
if ( query.type === req.params.type ) {
var params = [];
for (var p in query.params) {
params.push(p || null);
for (var p=0; p<query.params.length; p++) {
query.params[p] = query.params[p] || null;
}
req.db.queryFromFile(query.file, params, function (result) {
req.db.queryFromFile(query.file, query.params, function (result) {
req.db.done();
res.json(result.rows);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment