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

[FIX] Trying to fix state filter problem

parent 1090ab3f
No related branches found
No related tags found
3 merge requests!391Hom -> Prod,!386Merge development -> homologa,!383FIrst deploy of new route 'new_pnad'
......@@ -40,6 +40,12 @@ let rqf = new ReqQueryFields();
PnadNovoApp.use(cache('15 day'));
PnadNovoApp.get('/years', (req, res, next) => {
req.sql.from('pnad_novo')
.field('DISTINCT pnad_novo.ano_ref', 'year')
next();
}, query, response('years'));
rqf.addField({
name: 'filter',
field: false,
......@@ -57,7 +63,7 @@ rqf.addField({
type: 'integer',
field: 'id'
}
}).addValueToField({
}).addValue({
name: 'state',
table: 'estado',
tableField: ['nome', 'id'],
......@@ -72,7 +78,7 @@ rqf.addField({
foreign: 'cod_uf',
foreignTable: 'pnad_novo'
}
}, 'filter').addValue({
}).addValue({
name: 'state_not',
table: 'estado',
tableField: ['nome', 'id'],
......@@ -307,10 +313,5 @@ PnadNovoApp.get('/', (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