Skip to content
Snippets Groups Projects
Commit 57116c1f authored by Leon A. Okida Gonçalves's avatar Leon A. Okida Gonçalves
Browse files

Fix issue when calling id2str methods

parent 7e13849a
No related branches found
No related tags found
4 merge requests!377prd_version of simcaq,!368update filter in v2 school,!356Development,!355Fix issue when calling id2str methods
......@@ -40,6 +40,8 @@ const cache = require('apicache').options({ debug: config.debug, statusCodes: {i
let rqf = new ReqQueryFields();
const id2str = require(`${libs}/middlewares/id2str`);
simcaqEnrollmentDiagnosisApp.use(cache('15 day'));
rqf.addField({
......@@ -147,6 +149,6 @@ simcaqEnrollmentDiagnosisApp.get('/', rqf.parse(), rqf.build(), (req, res, next)
.group('ano_censo')
.group('simcaq_diagnostico_de_matricula.etapa');
next();
}, query, response('enrollmentDiagnosis'));
}, query, id2str.transform(), response('enrollmentDiagnosis'));
module.exports = simcaqEnrollmentDiagnosisApp;
......@@ -145,7 +145,7 @@ simcaqFirstReportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.sql.from('simcaq_relatorio_1')
.field('simcaq_relatorio_1.etapa', 'education_level_short_id')
.field('simcaq_relatorio_1.turno', 'shift_id')
.field('simcaq_relatorio_1.localizacao_id', 'location')
.field('simcaq_relatorio_1.localizacao_id', 'location_id')
.field('SUM(simcaq_relatorio_1.num_matriculas)', 'num_enrollments')
.field('SUM(simcaq_relatorio_1.num_escolas)', 'num_schools')
.field('ano_censo', 'year')
......@@ -154,11 +154,6 @@ simcaqFirstReportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
.group('simcaq_relatorio_1.turno')
.group('simcaq_relatorio_1.localizacao_id');
next();
}, query, (req, res, next) => {
req.result.forEach((result) => {
result.shift = id2str.shift(result.shift_id);
});
next();
}, response('simcaqFirstReport'));
}, query, id2str.transform(), response('simcaqFirstReport'));
module.exports = simcaqFirstReportApp;
......@@ -40,6 +40,8 @@ const cache = require('apicache').options({ debug: config.debug, statusCodes: {i
let rqf = new ReqQueryFields();
const id2str = require(`${libs}/middlewares/id2str`);
simcaqSecondReportApp.use(cache('15 day'));
rqf.addField({
......@@ -125,6 +127,6 @@ simcaqSecondReportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
.group('ano_censo')
.group('dependencia_adm_priv');
next();
}, query, response('simcaqSecondReport'));
}, query, id2str.transform(), response('simcaqSecondReport'));
module.exports = simcaqSecondReportApp;
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