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

Merge branch 'homologa' into 'master'

Hom -> Prod

See merge request !391
parents da7632ee e75cce6a
No related branches found
No related tags found
3 merge requests!408Development,!407Master,!391Hom -> Prod
Showing
with 670 additions and 6 deletions
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function attendedModality(id) {
switch (id) {
case 1:
return 'Creche';
case 2:
return 'Pré-escola';
case 3:
return 'Alfabetização de jovens e adultos';
case 4:
return 'Ensino Fundamental - Anos iniciais'
case 5:
return 'Ensino Fundamental - Anos finais';
case 6:
return 'EJA - Ensino Fundamental';
case 7:
return 'Ensino Médio';
case 8:
return 'Educação profissional - técnica integrada';
case 9:
return 'Educação profissional - técnica concomitante e subsequente';
case 10:
return 'Ensino Médio Regular e Profissional articulado';
case 11:
return 'EJA - Ensino Médio';
case 12:
return 'Superior';
case 13:
return 'Especialização';
case 14:
return 'Mestrado';
case 15:
return 'Doutorado';
case 99:
return 'Não frequenta instituição de ensino';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
// This file is used to convert the attendsSchool AND 'bolsa_familia' variable to a human-readable format.
module.exports = function attendsSchool(id) {
switch (id) {
case 1:
return 'Sim';
case 2:
return 'Não';
case 9:
return 'Sem informação';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function capitalCode(id) {
switch (id) {
case 11:
return 'Porto Velho';
case 12:
return 'Rio Branco';
case 13:
return 'Manaus';
case 14:
return 'Boa Vista';
case 15:
return 'Belém';
case 16:
return 'Macapá';
case 17:
return 'Palmas';
case 21:
return 'São Luís';
case 22:
return 'Teresina';
case 23:
return 'Fortaleza';
case 24:
return 'Natal';
case 25:
return 'João Pessoa';
case 26:
return 'Recife';
case 27:
return 'Maceió';
case 28:
return 'Aracaju';
case 29:
return 'Salvador';
case 31:
return 'Belo Horizonte';
case 32:
return 'Vitória';
case 33:
return 'Rio de Janeiro';
case 35:
return 'São Paulo';
case 41:
return 'Curitiba';
case 42:
return 'Florianópolis';
case 43:
return 'Porto Alegre';
case 50:
return 'Campo Grande';
case 51:
return 'Cuiabá';
case 52:
return 'Goiânia';
case 53:
return 'Brasília';
case 99:
return 'Não é capital';
default:
return 'Não informado';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function ethnicGroupNewPnad(id) {
switch (id) {
case 1:
return 'Branca';
case 2:
return 'Preta';
case 3:
return 'Amarela';
case 4:
return 'Parda';
case 5:
return 'Indígena';
case 9:
return 'Não declarado';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function illiteracy(id) {
switch (id) {
case 0:
return 'Não';
case 1:
return 'Sim';
case 9:
return 'Não se aplica - 14 anos ou menos';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function incomeRange(id) {
switch (id) {
case 1:
return 'Até 1/4 salário mínimo';
case 2:
return 'Mais de 1/4 até 1/2 salário mínimo';
case 3:
return 'Mais de 1/2 até 1 salário mínimo';
case 4:
return 'De 1 a 2 salários mínimos';
case 5:
return 'Mais de 2 até 3 salários mínimos';
case 6:
return 'Mais de 3 até 5 salários mínimos';
case 7:
return 'Mais de 5 salários mínimos';
case 9:
return 'Não informado ou ignorado';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function instructionLevel(id) {
switch (id) {
case 1:
return 'Sem instrução e menos de 1 ano de estudo';
case 2:
return 'Fundamental incompleto ou equivalente';
case 3:
return 'Fundamental completo ou equivalente';
case 4:
return 'Médio incompleto ou equivalente';
case 5:
return 'Médio completo ou equivalente';
case 6:
return 'Superior incompleto ou equivalente';
case 7:
return 'Superior completo ou equivalente';
case 99:
return 'Não se aplica - 17 anos ou menos';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function metroCode(id) {
switch (id) {
case 13:
return 'Região Metropolitana de Manaus';
case 15:
return 'Região Metropolitana de Belém';
case 16:
return 'Região Metropolitana de Macapá';
case 21:
return 'Região Metropolitana de Grande São Luís';
case 22:
return 'Região Administrativa Integrada de Desenvolvimento de Grande Teresina'
case 23:
return 'Região Metropolitana de Fortaleza';
case 24:
return 'Região Metropolitana de Natal';
case 25:
return 'Região Metropolitana de João Pessoa';
case 26:
return 'Região Metropolitana de Recife';
case 27:
return 'Região Metropolitana de Maceió';
case 28:
return 'Região Metropolitana de Aracaju';
case 29:
return 'Região Metropolitana de Salvador';
case 31:
return 'Região Metropolitana de Belo Horizonte';
case 32:
return 'Região Metropolitana de Grande Vitória';
case 33:
return 'Região Metropolitana do Rio de Janeiro';
case 35:
return 'Região Metropolitana de São Paulo';
case 41:
return 'Região Metropolitana de Curitiba';
case 42:
return 'Região Metropolitana de Florianópolis';
case 43:
return 'Região Metropolitana de Porto Alegre';
case 51:
return 'Região Metropolitana de Vale do Rio Cuiabá';
case 52:
return 'Região Metropolitana de Goiânia';
case 99:
return 'Não é região metropolitana ou região administrativa integrada';
default:
return 'Não informado';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function modality(id) {
switch (id) {
case 1:
return 'Presencial';
case 2:
return 'A distância';
case 3:
return 'Não informado';
case 9:
return 'Sem dados para 2022';
case 99:
return 'Não frequenta instituição de ensino'
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function modalityShift(id) {
switch (id) {
case 1:
return 'Matutino';
case 2:
return 'Vespertino';
case 3:
return 'Noturno';
case 4:
return 'Integral - matutino e vespertino';
case 5:
return 'Outros';
case 6:
return 'Não se aplica - pós graduação presencial';
case 7:
return 'EaD ou semipresencial';
case 9:
return 'Não informado';
case 99:
return 'Não frequenta instituição de ensino';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function newPnadAdmDependency(id) {
switch (id) {
case 1:
return 'Pública';
case 2:
return 'Privada';
case 99:
return 'Não frequenta instituição de ensino';
}
};
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function regionCode(id) {
switch (id) {
case 1:
return 'Norte';
case 2:
return 'Nordeste';
case 3:
return 'Sudeste';
case 4:
return 'Sul'
case 5:
return 'Centro-Oeste';
}
};
...@@ -76,5 +76,7 @@ module.exports = function stateName(id) { ...@@ -76,5 +76,7 @@ module.exports = function stateName(id) {
return 'Distrito Federal'; return 'Distrito Federal';
case 99: case 99:
return 'Exterior'; return 'Exterior';
default:
return 'Não declarada';
} }
}; };
/*
Copyright (C) 2024 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of simcaq-node.
simcaq-node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
simcaq-node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function yearsOfStudy(id) {
switch (id) {
case 0:
return 'Sem instrução e menos de 1 ano de estudo';
case 1:
return '1 ano de estudo';
case 2:
return '2 anos de estudo';
case 3:
return '3 anos de estudo';
case 4:
return '4 anos de estudo';
case 5:
return '5 anos de estudo';
case 6:
return '6 anos de estudo';
case 7:
return '7 anos de estudo';
case 8:
return '8 anos de estudo';
case 9:
return '9 anos de estudo';
case 10:
return '10 anos de estudo';
case 11:
return '11 anos de estudo';
case 12:
return '12 anos de estudo';
case 13:
return '13 anos de estudo';
case 14:
return '14 anos de estudo';
case 15:
return '15 anos de estudo';
case 16:
return '16 anos ou mais de estudo';
case 99:
return 'Não se aplica - 17 anos ou menos';
}
};
...@@ -101,6 +101,19 @@ const supplyDimension = require(`${libs}/convert/supplyDimension`); ...@@ -101,6 +101,19 @@ const supplyDimension = require(`${libs}/convert/supplyDimension`);
const type = require(`${libs}/convert/type`); const type = require(`${libs}/convert/type`);
const level = require(`${libs}/convert/level`); const level = require(`${libs}/convert/level`);
const scholarDependency = require(`${libs}/convert/scholarDependency`); const scholarDependency = require(`${libs}/convert/scholarDependency`);
const newPnadAdmDependency = require(`${libs}/convert/newPnadAdmDependency`);
const illiteracy = require(`${libs}/convert/illiteracy`);
const yearsOfStudy = require(`${libs}/convert/yearsOfStudy`);
const instructionLevel = require(`${libs}/convert/instructionLevel`);
const attendsSchool = require(`${libs}/convert/attendsSchool`);
const modality = require(`${libs}/convert/modality`);
const attendedModality = require(`${libs}/convert/attendedModality`);
const ethnicGroupNewPnad = require(`${libs}/convert/ethnicGroupNewPnad`);
const capitalCode = require(`${libs}/convert/capitalCode`);
const regionCode = require(`${libs}/convert/regionCode`);
const metroCode = require(`${libs}/convert/metroCode`);
const modalityShift = require(`${libs}/convert/modalityShift`);
const incomeRange = require(`${libs}/convert/incomeRange`);
const ids = { const ids = {
gender_id: gender, gender_id: gender,
...@@ -193,7 +206,21 @@ const ids = { ...@@ -193,7 +206,21 @@ const ids = {
supply_dimension_id: supplyDimension, supply_dimension_id: supplyDimension,
type_id: type, type_id: type,
level_id: level, level_id: level,
scholar_dependency_id: scholarDependency scholar_dependency_id: scholarDependency,
new_pnad_adm_dependency_id: newPnadAdmDependency,
illiteracy_id: illiteracy,
years_of_study_id: yearsOfStudy,
instruction_level_id: instructionLevel,
attends_school_id: attendsSchool,
modality_id: modality,
attended_modality_id: attendedModality,
bolsa_familia_id: attendsSchool,
new_pnad_ethnic_group_id: ethnicGroupNewPnad,
cap_code_id: capitalCode,
region_id: regionCode,
metro_code_id: metroCode,
modality_shift_id: modalityShift,
income_range_id: incomeRange
}; };
function transform(removeId=false) { function transform(removeId=false) {
...@@ -309,5 +336,18 @@ module.exports = { ...@@ -309,5 +336,18 @@ module.exports = {
peePorCategoria, peePorCategoria,
pee, pee,
shift, shift,
admDependencyPub admDependencyPub,
newPnadAdmDependency,
illiteracy,
yearsOfStudy,
instructionLevel,
attendsSchool,
modality,
attendedModality,
ethnicGroupNewPnad,
capitalCode,
regionCode,
metroCode,
modalityShift,
incomeRange
}; };
...@@ -117,9 +117,9 @@ activityApp.get('/:id', (req, res, next) => { ...@@ -117,9 +117,9 @@ activityApp.get('/:id', (req, res, next) => {
let actJSON = act.toJSON(); let actJSON = act.toJSON();
//transform data yyyy-mm-dd to dd/mm/yyyy //transform data yyyy-mm-dd to dd/mm/yyyy
let date = actJSON.date.split('-'); let date = actJSON.date.split('-');
let date_headline = actJSON.date_headline.split('-'); let date_start= actJSON.date_start.split('-');
actJSON.date = date[2] + '/' + date[1] + '/' + date[0]; actJSON.date = date[2] + '/' + date[1] + '/' + date[0];
actJSON.date_headline = date_headline[2] + '/' + date_headline[1] + '/' + date_headline[0]; actJSON.date_start = date_start[2] + '/' + date_start[1] + '/' + date_start[0];
req.result = actJSON; req.result = actJSON;
next(); next();
} }
...@@ -159,7 +159,8 @@ activityApp.post('/', passport.authenticate('bearer', { session: false }), autho ...@@ -159,7 +159,8 @@ activityApp.post('/', passport.authenticate('bearer', { session: false }), autho
text: req.body.texto, text: req.body.texto,
name_headline: req.body.nome, name_headline: req.body.nome,
resume_headline: req.body.resumo, resume_headline: req.body.resumo,
date_headline: transformDateFormat(req.body.dataAtividade), date_start: transformDateFormat(req.body.dataInicio),
date_end: transformDateFormat(req.body.dataEnd),
local_headline: req.body.local, local_headline: req.body.local,
additional_headline: req.body.informacoes, additional_headline: req.body.informacoes,
is_draft: req.body.rascunho, is_draft: req.body.rascunho,
...@@ -207,7 +208,8 @@ activityApp.put('/:id', passport.authenticate('bearer', { session: false }), aut ...@@ -207,7 +208,8 @@ activityApp.put('/:id', passport.authenticate('bearer', { session: false }), aut
act.text = req.body.texto || act.text; act.text = req.body.texto || act.text;
act.name_headline = req.body.nome || act.name_headline; act.name_headline = req.body.nome || act.name_headline;
act.resume_headline = req.body.resumo || act.resume_headline; act.resume_headline = req.body.resumo || act.resume_headline;
act.date_headline = req.body.dataAtividade || act.date_headline; act.date_start = req.body.dataStart || act.date_start;
act.date_end = req.body.dataEnd || act.date_end;
act.local_headline = req.body.local || act.local_headline; act.local_headline = req.body.local || act.local_headline;
act.additional_headline = req.body.informacoes || act.additional_headline; act.additional_headline = req.body.informacoes || act.additional_headline;
act.is_draft = req.body.rascunho || act.is_draft; act.is_draft = req.body.rascunho || act.is_draft;
......
...@@ -141,6 +141,10 @@ const publication = require(`${libs}/routes_v1/publication`); ...@@ -141,6 +141,10 @@ const publication = require(`${libs}/routes_v1/publication`);
const activity = require(`${libs}/routes_v1/activity`); const activity = require(`${libs}/routes_v1/activity`);
const newPnad = require(`${libs}/routes_v1/newPnad`);
const email = require(`${libs}/routes_v1/email`);
api.get('/', (req, res) => { api.get('/', (req, res) => {
res.json({ msg: 'SimCAQ API v1 is running' }); res.json({ msg: 'SimCAQ API v1 is running' });
}); });
...@@ -200,6 +204,7 @@ api.use('/disciplines', disciplines); ...@@ -200,6 +204,7 @@ api.use('/disciplines', disciplines);
api.use('/universityLocalOffer', universityLocalOffer); api.use('/universityLocalOffer', universityLocalOffer);
api.use('/message', message); api.use('/message', message);
api.use('/course_students', courseStudents); api.use('/course_students', courseStudents);
api.use('/new_pnad', newPnad);
//Publication //Publication
api.use('/publication', publication); api.use('/publication', publication);
...@@ -207,4 +212,7 @@ api.use('/publication', publication); ...@@ -207,4 +212,7 @@ api.use('/publication', publication);
//Activity //Activity
api.use('/activity', activity); api.use('/activity', activity);
//Email
api.use('/email', email);
module.exports = api; module.exports = api;
const express = require('express');
const email = require(`../middlewares/email`);
const log = require(`../log`)(module);
const emailApp = express();
const libs = `${process.cwd()}/libs`;
const User = require(`${libs}/models/user`);
const passport = require('passport');
emailApp.get('/', async (req, res, next) => {
var emails = await User.findAll({attributes:['name','email']});
const emailsArray = emails.map(_email => _email.get());
res.json(emailsArray);
})
module.exports = emailApp;
...@@ -348,6 +348,7 @@ liquidEnrollmentRatioApp.get('/', rqf.parse(),(req, res, next) => { ...@@ -348,6 +348,7 @@ liquidEnrollmentRatioApp.get('/', rqf.parse(),(req, res, next) => {
if ("education_level_short" in req.filter) { if ("education_level_short" in req.filter) {
if (Array.isArray(req.filter.education_level_short)) { if (Array.isArray(req.filter.education_level_short)) {
console.log("ENTROU NO PRIMEIRO IF")
var stringQuery = ''; var stringQuery = '';
for(let i = 0; i < req.filter.education_level_short.length - 1; i++) { for(let i = 0; i < req.filter.education_level_short.length - 1; i++) {
stringQuery = stringQuery + ConvertEnrollment(req.filter.education_level_short[i]) + ' OR '; stringQuery = stringQuery + ConvertEnrollment(req.filter.education_level_short[i]) + ' OR ';
...@@ -389,6 +390,7 @@ liquidEnrollmentRatioApp.get('/', rqf.parse(),(req, res, next) => { ...@@ -389,6 +390,7 @@ liquidEnrollmentRatioApp.get('/', rqf.parse(),(req, res, next) => {
if ("education_level_short" in req.filter) { if ("education_level_short" in req.filter) {
if (Array.isArray(req.filter.education_level_short)) { if (Array.isArray(req.filter.education_level_short)) {
console.log("ENTROU NO SEGUNDO IF")
var stringQuery = ''; var stringQuery = '';
for(let i = 0; i < req.filter.education_level_short.length - 1; i++) { for(let i = 0; i < req.filter.education_level_short.length - 1; i++) {
stringQuery = stringQuery + convertPnad(req.filter.education_level_short[i]) + ' OR '; stringQuery = stringQuery + convertPnad(req.filter.education_level_short[i]) + ' OR ';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment