Skip to content
Snippets Groups Projects
Commit 48441f1f authored by jpko19's avatar jpko19
Browse files

Fix pee_por_categoria(3)

parent 07e3399b
Branches
Tags
3 merge requests!329Update enrollment - new filters,!324Dev,!309Merge new updates into master
......@@ -175,7 +175,7 @@ class ReqQueryFields {
let categorias = ['', 'blindness', 'low_vision', 'deafness', 'hearing_deficiency', 'deafblindness', 'physical_disability', 'intellectual_disability',
'multiple_disabilities', 'autism', 'asperger_syndrom', 'rett_syndrom', 'childhood_desintegrative_disorder', 'supergifted'];
if(obj.pee_por_categoria !== undefined)
if(obj.pee_por_categoria !== undefined && queryField === 'filter')
for(var cat of obj.pee_por_categoria)
obj[categorias[cat]] = true;
......
......@@ -770,7 +770,8 @@ rqf.addField({
});
enrollmentApp.get('/', rqf.parse(), (req, res, next) => {
if('pee_por_categotria' in req.dims){
console.log(req.dims)
if('pee_por_categoria' in req.dims){
req.sql.field('SUM(CASE WHEN cegueira = true THEN 1 ELSE 0)', 'total_cegueira')
.field('SUM(CASE WHEN baixa_visao = true THEN 1 ELSE 0)', 'total_baixa_visao')
.field('SUM(CASE WHEN surdez = true THEN 1 ELSE 0)', 'total_surdez')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment