Skip to content
Snippets Groups Projects
Commit 385740b0 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Fix ethnic group in out of school route

parent 919b5778
No related branches found
No related tags found
1 merge request!124Release v1.1.0
Pipeline #
...@@ -56,15 +56,17 @@ outOfSchoolApp.get('/full_age_range', (req, res, next) => { ...@@ -56,15 +56,17 @@ outOfSchoolApp.get('/full_age_range', (req, res, next) => {
next(); next();
}, response('full_age_range')); }, response('full_age_range'));
outOfSchoolApp.get('/ethnic_group_pnad', (req, res, next) => { outOfSchoolApp.get('/ethnic_group', (req, res, next) => {
req.result = [ req.result = [
{id: 0, name: 'Indígena'}, {id: 0, name: 'Sem declaração'},
{id: 1, name: 'Branca e amarela'}, {id: 1, name: 'Branca'},
{id: 2, name: 'Preta e parda'}, {id: 2, name: 'Preta'},
{id: 9, name: 'Sem declaração'} {id: 3, name: 'Parda'},
{id: 4, name: 'Amarela'},
{id: 5, name: 'Indígena'}
]; ];
next(); next();
}, response('ethnic_group_pnad')); }, response('ethnic_group'));
outOfSchoolApp.get('/location', (req, res, next) => { outOfSchoolApp.get('/location', (req, res, next) => {
req.result = [ req.result = [
...@@ -142,14 +144,14 @@ rqf.addField({ ...@@ -142,14 +144,14 @@ rqf.addField({
foreignTable: 'pnad' foreignTable: 'pnad'
} }
}).addValue({ }).addValue({
name: 'ethnic_group_pnad', name: 'ethnic_group',
table: 'pnad', table: 'pnad',
tableField: 'cor_raca', tableField: 'cor_raca_id',
resultField: 'ethnic_group_pnad_id', resultField: 'ethnic_group_id',
where: { where: {
relation: '=', relation: '=',
type: 'integer', type: 'integer',
field: 'cor_raca' field: 'cor_raca_id'
} }
}).addValue({ }).addValue({
name: 'min_year', name: 'min_year',
...@@ -176,7 +178,7 @@ rqf.addField({ ...@@ -176,7 +178,7 @@ rqf.addField({
}).addValue({ }).addValue({
name: 'full_age_range', name: 'full_age_range',
table: 'pnad', table: 'pnad',
tableField: 'idade_31_03', tableField: 'faixa_etaria_31_03',
resultField: 'full_age_range_id', resultField: 'full_age_range_id',
where: { where: {
relation: '=', relation: '=',
......
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