Skip to content
Snippets Groups Projects
Commit ebb0b736 authored by Victor Picussa's avatar Victor Picussa
Browse files

[v1.11.4]Fixes and modifications

parent bd863004
No related branches found
No related tags found
1 merge request!215V1.11.4
Pipeline #20733 failed
......@@ -6,9 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## 1.11.4 - 2019-06-17
## Changed
- Changed enrollment varaible
- Changed enrollment variable
- Added location and latitude to state and city
- Changed courseCount variables
- Removed 'Not classified' from teacher
## 1.11.3 - 2019-06-17
## Changed
......
/*
Copyright (C) 2016 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/>.
*/
const express = require('express');
const teacherApp = express.Router();
......@@ -18,10 +38,6 @@ const id2str = require(`${libs}/middlewares/id2str`);
const config = require(`${libs}/config`);
const passport = require('passport');
const download = require(`${libs}/middlewares/downloadDatabase`);
const addMissing = require(`${libs}/middlewares/addMissing`);
const cache = require('apicache').options({ debug: config.debug, statusCodes: {include: [200]} }).middleware;
......@@ -81,11 +97,6 @@ teacherApp.get('/education_level_mod', (req, res, next) => {
name: id2str.educationLevelMod(i)
});
}
req.result.push({
id: 99,
name: id2str.educationLevelMod(99)
});
next();
}, response('education_level_mod'));
......@@ -408,37 +419,6 @@ teacherApp.get('/', rqf.parse(), (req, res, next) => {
}
next();
}, rqf.build(), query, addMissing(rqf), (req, res, next) => {
req.oldResult = req.result;
if(req.hadEducationLevelMod) {
req.sql = squel.select()
.field('COUNT(DISTINCT docente.id_docente)', 'total')
.field("'Brasil'", 'name')
.field('docente.ano_censo', 'year')
.from('docente')
.join('turma', null, 'docente.turma_id=turma.id AND docente.ano_censo=turma.ano_censo')
.group('docente.ano_censo')
.order('docente.ano_censo')
.where('(docente.tipo_docente = 1 OR docente.tipo_docente = 5) AND (turma.tipo_turma_id <= 3)')
.where('docente.profissionalizante = 1');
rqf.build()(req, res, () => {});
query(req, res, next);
} else {
next();
}
}, (req, res, next) => {
if(req.hadEducationLevelMod) {
req.result.forEach((result) => {
result.education_level_mod_id = 11;
req.oldResult.push(result);
});
}
req.result = req.oldResult;
next();
}, id2str.transform(), response('teacher'));
teacherApp.get('/download', passport.authenticate('bearer', { session: false }), rqf.parse(), rqf.build(), download('docente', 'mapping_docente'));
}, rqf.build(), query, addMissing(rqf), id2str.transform(), response('teacher'));
module.exports = teacherApp;
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