Commit d2f0105a authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira
Browse files

Issue #25: Fix wrong parsing of api options


Signed-off-by: Lucas Fernandes de Oliveira's avatarLucas Fernandes de Oliveira <lfo14@inf.ufpr.br>
parent 17dc567f
Pipeline #11072 passed with stage
in 42 seconds
......@@ -46,8 +46,8 @@ export class PostgresAdapter extends Adapter {
this.pool.connect((err, client, done) => {
if (err) {
cb (err);
return;
}
client.query(query, [], (error, result) => {
// call 'done()' to release client back to pool
done();
......
......@@ -24,8 +24,8 @@ import { Query } from "../../common/query";
export class DataCtrl {
public static read(req: Request, res: express.Response, next: express.NextFunction) {
let metrics = req.query.metrics.split(",");
let dimensions = req.query.dimensions.split(",");
let metrics = req.query.metrics.split(",").filter((item: string) => item !== "");
let dimensions = req.query.dimensions.split(",").filter((item: string) => item !== "");
let view;
try {
......@@ -34,7 +34,7 @@ export class DataCtrl {
query.metrics.push(req.engine.getMetricByName(metrics[i]));
}
for (let i = 0; i < metrics.length; ++i) {
for (let i = 0; i < dimensions.length; ++i) {
query.dimensions.push(req.engine.getDimensionByName(dimensions[i]));
}
view = req.engine.query(query);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment