From ab5fb9eff8fd0fbaecf89e598311d5b2af73f7a0 Mon Sep 17 00:00:00 2001 From: Vytor Calixto <vytorcalixto@gmail.com> Date: Thu, 26 Oct 2017 11:59:38 -0200 Subject: [PATCH] Add years 2013 and 2014 to route idhml --- src/libs/routes/idhml.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libs/routes/idhml.js b/src/libs/routes/idhml.js index 08c71630..3a36276a 100644 --- a/src/libs/routes/idhml.js +++ b/src/libs/routes/idhml.js @@ -25,14 +25,12 @@ idhmlApp.use(cache('15 day')); idhmlApp.get('/year_range', (req, res, next) => { req.sql.from('adh_idh') .field('MIN(adh_idh.ano_censo)', 'start_year') - .field('MAX(adh_idh.ano_censo)', 'end_year') - .where('adh_idh.ano_censo <> 2014 AND adh_idh.ano_censo <> 2013'); + .field('MAX(adh_idh.ano_censo)', 'end_year'); next(); }, query, (req, res, next) => { req.sql.from('adh_idh_uf') .field('MIN(adh_idh_uf.ano_censo)', 'start_year') - .field('MAX(adh_idh_uf.ano_censo)', 'end_year') - .where('adh_idh_uf.ano_censo <> 2014 AND adh_idh_uf.ano_censo <> 2013'); + .field('MAX(adh_idh_uf.ano_censo)', 'end_year'); req.old_result = req.result; next(); }, query, (req, res, next) => { @@ -47,8 +45,7 @@ idhmlApp.get('/year_range', (req, res, next) => { idhmlApp.get('/years', (req, res, next) => { req.sql.from('adh_idh') - .field('DISTINCT adh_idh.ano_censo', 'year') - .where('adh_idh.ano_censo <> 2014 AND adh_idh.ano_censo <> 2013'); + .field('DISTINCT adh_idh.ano_censo', 'year'); next(); }, query, (req, res, next) => { req.oldResult = req.result; @@ -56,8 +53,7 @@ idhmlApp.get('/years', (req, res, next) => { req.sql = squel.select(); req.sql.from('adh_idh_uf') - .field('DISTINCT adh_idh_uf.ano_censo', 'year') - .where('adh_idh_uf.ano_censo <> 2014 AND adh_idh_uf.ano_censo <> 2013'); + .field('DISTINCT adh_idh_uf.ano_censo', 'year'); next(); }, query, (req, res, next) => { let result = Object.assign(req.oldResult, req.result); -- GitLab