Skip to content
Snippets Groups Projects
Commit 4cb8e758 authored by Fernando Erd's avatar Fernando Erd :ok_hand:
Browse files

Merge branch 'idh_r' into 'development'

Fix Filter IDHM level

See merge request !66
parents e463fd12 a9ba081e
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!66Fix Filter IDHM level
Pipeline #
module.exports = function idhmLevel(id) {
switch (id) {
case 1:
return 'Muito Baixa';
case 2:
return 'Baixo';
case 3:
return 'Médio';
case 4:
return 'Alto';
case 5:
return 'Muito Alto';
default:
return 'Não classificado';
}
};
......@@ -14,6 +14,7 @@ const educationLevelShort = require(`${libs}/convert/educationLevelShort`);
const educationType = require(`${libs}/convert/educationType`);
const citySize = require(`${libs}/convert/citySize`);
const incomeLevel = require(`${libs}/convert/incomeLevel`);
const idhmLevel = require(`${libs}/convert/idhmLevel`);
const ids = {
gender_id: gender,
......@@ -60,7 +61,8 @@ const ids = {
water_id: booleanVariable,
education_type_id: educationType,
income_level_id: incomeLevel,
city_size_id: citySize
city_size_id: citySize,
idhm_level_id: idhmLevel
};
function transform(removeId=false) {
......
......@@ -116,10 +116,10 @@ rqf.addField({
field: 'ano_censo'
}
}).addValue({
name: 'IDHM_level',
name: 'idhm_level',
table: '@',
tableField: 'idhm_nivel',
resultField: 'idhm_nivel_id',
resultField: 'idhm_level_id',
where: {
relation: '=',
type: 'integer',
......@@ -163,6 +163,6 @@ idhmApp.get('/', rqf.parse(), (req, res, next) => {
});
}
next();
}, rqf.build(),query, response('idhm'));
}, rqf.build(), query, id2str.transform(), response('idhm'));
module.exports = idhmApp;
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