Skip to content
Snippets Groups Projects
Commit 52f53c2f authored by Fernando Erd's avatar Fernando Erd :ok_hand:
Browse files

Fix error in idhm where city in filter

parent 35aa14f6
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!64Fix error where city in filter
Pipeline #
......@@ -138,8 +138,7 @@ idhmApp.get('/', rqf.parse(), (req, res, next) => {
message: 'Wrong/No filter specified'
});
}
if ("state" in req.filter) {
console.log("BBBBB");
if ("state" in req.filter && !("city" in req.filter)) {
req.sql.from('adh_idh_uf')
.field('adh_idh_uf.idhm', 'total')
.field('adh_idh_uf.ano_censo', 'year')
......@@ -147,34 +146,16 @@ idhmApp.get('/', rqf.parse(), (req, res, next) => {
.group('adh_idh_uf.idhm')
.group('adh_idh_uf.ano_censo')
.group('adh_idh_uf.estado_id')
} else if ("state" in req.dims) {
console.log("AAAAAAAAA");
} else if ("city" in req.filter) {
req.sql.from('adh_idh')
.field('adh_idh.idhm', 'total')
.field('adh_idh.ano_censo', 'year')
.field('adh_idh.municipio_id', 'city_id')
.field('adh_idh.estado_id', 'state_id')
.field('adh_idh.estado_id', 'city_id')
.group('adh_idh.idhm')
.group('adh_idh.ano_censo')
.group('adh_idh.municipio_id')
.group('adh_idh.estado_id')
} else if ("city" in req.filter) {
req.sql.from('adh_idh')
.field('adh_idh.idhm', 'total')
.field('adh_idh.ano_censo', 'year')
.field('adh_idh.municipio_id', 'city_id')
.group('adh_idh.idhm')
.group('adh_idh.ano_censo')
.group('adh_idh.municipio_id')
} else if ("city" in req.dims) {
req.sql.from('adh_idh')
.field('adh_idh.idhm', 'total')
.field('adh_idh.ano_censo', 'year')
.field('adh_idh.municipio_id', 'city_id')
.group('adh_idh.idhm')
.group('adh_idh.ano_censo')
.group('adh_idh.municipio_id')
.group('adh_idh.estado_id')
} else {
next({
status: 400,
......
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