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

Merge branch 'tgcl21-fixing-instructionlevel' into 'development'

fixed instruction level filters

See merge request !442
parents 00b7dbc2 da4a8a31
No related branches found
No related tags found
3 merge requests!449Homologa,!444dev -> hom,!442fixed instruction level filters
...@@ -61,6 +61,64 @@ NivelInstrucao.get('/instruction_level', (req, res, next) => { ...@@ -61,6 +61,64 @@ NivelInstrucao.get('/instruction_level', (req, res, next) => {
next(); next();
}, response('instruction_level')); }, response('instruction_level'));
NivelInstrucao.get('/age_range_all', (req, res, next) => {
req.result = []
for (let i = 1; i < 9; i++) {
req.result.push({
id: i, name: id2str.ageRangeAll(i)
});
}
req.result.push({id: 99, name: id2str.ageRangeAll(99)});
next();
}, response('age_range_all'));
NivelInstrucao.get('/gender', (req, res, next) => {
req.result = []
for (let i = 1; i < 3; i++) {
req.result.push({
id: i, name: id2str.gender(i)
});
}
next();
}, response('gender'));
NivelInstrucao.get('/bolsa_familia', (req, res, next) => {
req.result = []
for (let i = 1; i < 3; i++) {
req.result.push({
id: i, name: id2str.attendsSchool(i)
});
}
req.result.push({id: 9, name: id2str.attendsSchool(9)});
next();
}, response('bolsa_familia'));
NivelInstrucao.get('/location', (req, res, next) => {
req.result = []
for (let i = 1; i <= 2; i++) {
req.result.push({
id: i, name: id2str.location(i)
});
}
next();
}, response('location'));
NivelInstrucao.get('/ethnic_group', (req, res, next) => {
req.result = [];
for(let i = 0; i <=5; ++i) {
req.result.push({
id: i,
name: id2str.ethnicGroup(i)
});
}
next();
}, response('ethnic_group'));
rqf.addField({ rqf.addField({
name: 'filter', name: 'filter',
field: false, field: false,
...@@ -78,16 +136,6 @@ rqf.addField({ ...@@ -78,16 +136,6 @@ rqf.addField({
type: 'integer', type: 'integer',
field: 'id' field: 'id'
} }
}).addValue({
name: 'location',
table: 'pnad_novo',
tableField: 'tipo_de_area',
resultField: 'location_id',
where: {
relation: '=',
type: 'integer',
field: 'id'
}
}).addValue({ }).addValue({
name: 'bolsa_familia', name: 'bolsa_familia',
table: 'pnad_novo', table: 'pnad_novo',
...@@ -223,6 +271,16 @@ rqf.addField({ ...@@ -223,6 +271,16 @@ rqf.addField({
type: 'integer', type: 'integer',
field: 'recebeu_rendimentos_de_programa_bolsa_familia' field: 'recebeu_rendimentos_de_programa_bolsa_familia'
} }
}).addValue({
name: 'location',
table: 'pnad_novo',
tableField: 'situacao_domicilio',
resultField: 'location_id',
where: {
relation: '=',
type: 'integer',
field: 'situacao_domicilio'
}
}) })
NivelInstrucao.get('/', rqf.parse(), rqf.build(), (req, res, next) => { NivelInstrucao.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
......
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