Skip to content
Snippets Groups Projects
Commit 09bddd00 authored by Fernando Gbur dos Santos's avatar Fernando Gbur dos Santos
Browse files

[ADD] Adding subroute 'years' to newPnad.js

parent 9807ad23
No related branches found
No related tags found
3 merge requests!391Hom -> Prod,!386Merge development -> homologa,!383FIrst deploy of new route 'new_pnad'
......@@ -298,7 +298,7 @@ rqf.addField({
}
}, 'filter');
PnadNovoApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
PnadNovoApp.get('/', (req, res, next) => {
req.sql.from('pnad_novo')
.field('round(sum(pnad_novo.peso_domicilio_pessoas_com_cal), 0)', 'total')
.field('pnad_novo.ano_ref', 'year')
......@@ -308,5 +308,10 @@ PnadNovoApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
next();
}, query, response('pnad_novo'));
PnadNovoApp.get('/years', (req, res, next) => {
req.sql.from('pnad_novo')
.field('DISTINCT pnad_novo.ano_ref', 'year')
next();
}, query, response('years'));
module.exports = PnadNovoApp;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment