Skip to content
Snippets Groups Projects
Commit f6b211bc authored by Lucas Gabriel Lima's avatar Lucas Gabriel Lima
Browse files

add auxiliary route city_size to population

parent d62cdf0d
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!58Pib per capita e População
Pipeline #
...@@ -25,6 +25,19 @@ populationApp.get('/year_range', (req, res, next) => { ...@@ -25,6 +25,19 @@ populationApp.get('/year_range', (req, res, next) => {
next(); next();
}, query, response('range')); }, query, response('range'));
populationApp.get('/city_size', (req, res, next) => {
req.result = [
{id: 1, name: "até 5000"},
{id: 2, name: "5001 - 10000"},
{id: 3, name: "10001 - 20000"},
{id: 4, name: "20001 - 50000"},
{id: 5, name: "50001 - 100000"},
{id: 6, name: "100001 - 500000"},
{id: 7, name: "mais que 500000"}
];
next();
}, response('city_size'));
rqf.addField({ rqf.addField({
name: 'filter', name: 'filter',
field: false, field: false,
...@@ -101,6 +114,16 @@ rqf.addField({ ...@@ -101,6 +114,16 @@ rqf.addField({
type: 'integer', type: 'integer',
field: 'ano_censo' field: 'ano_censo'
} }
}).addValue({
name: 'city_size',
table: 'ibge_populacao',
tableField: 'porte',
resultField: 'city_size_id',
where: {
relation: '=',
type: 'integer',
field: 'porte'
}
}); });
populationApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { populationApp.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