From 00e7a9c8ca3b653e3b152da84fd64bfe756adafb Mon Sep 17 00:00:00 2001 From: Vytor Calixto <vytorcalixto@gmail.com> Date: Wed, 27 Jun 2018 10:09:17 -0300 Subject: [PATCH] Restrict year range of Out of School indicator Related: simcaq/SCRUM#402 --- src/libs/routes/outOfSchool.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/routes/outOfSchool.js b/src/libs/routes/outOfSchool.js index 822ef3a8..d7e3915a 100644 --- a/src/libs/routes/outOfSchool.js +++ b/src/libs/routes/outOfSchool.js @@ -29,13 +29,15 @@ outOfSchoolApp.use(cache('15 day')); outOfSchoolApp.get('/year_range', (req, res, next) => { req.sql.from('pnad') .field('MIN(pnad.ano_censo)', 'start_year') - .field('MAX(pnad.ano_censo)', 'end_year'); + .field('MAX(pnad.ano_censo)', 'end_year') + .where('pnad.ano_censo >= 2007 AND pnad.ano_censo <= 2015'); next(); }, query, response('range')); outOfSchoolApp.get('/years', (req, res, next) => { req.sql.from('pnad'). - field('DISTINCT pnad.ano_censo', 'year'); + field('DISTINCT pnad.ano_censo', 'year') + .where('pnad.ano_censo >= 2007 AND pnad.ano_censo <= 2015'); next(); }, query, response('years')); -- GitLab