Commit 48428386 authored by Pietro Cavassin's avatar Pietro Cavassin
Browse files

Merge branch 'issue792_Pietro' into 'dev'

Issue792 pietro

See merge request !317
parents 576e5a68 97309420
......@@ -19,7 +19,7 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = function booleanVariable(id) {
if (id == null)
if (id == null || id == "null")
return 'Não Declarado';
else if (id == false)
return 'Não';
......
......@@ -28,7 +28,8 @@ module.exports = function workRegime(id) {
return 'Tempo Parcial';
case 4:
return 'Horista';
case "null":
default:
return 'Não declarado';
return 'Não Declarado';
}
};
......@@ -91,7 +91,10 @@ teacherEnrollmentApp.get('/teacher_situation', (req, res, next) => {
}, response('teacher_situation'));
teacherEnrollmentApp.get('/work_regime', (req, res, next) => {
req.result = [];
req.result = [{
id: "null",
name: id2str.workRegime("null")
}];
for(let i = 1; i <= 4; ++i) {
req.result.push({
id: i,
......@@ -102,7 +105,10 @@ teacherEnrollmentApp.get('/work_regime', (req, res, next) => {
}, response('work_regime'));
teacherEnrollmentApp.get('/substitute', (req, res, next) => {
req.result = [];
req.result = [{
id: "null",
name: id2str.booleanVariable("null")
}];
for(let i = 0; i <= 1; ++i) {
req.result.push({
id: i,
......@@ -113,7 +119,10 @@ teacherEnrollmentApp.get('/substitute', (req, res, next) => {
}, response('substitute'));
teacherEnrollmentApp.get('/visitor', (req, res, next) => {
req.result = [];
req.result = [{
id: "null",
name: id2str.booleanVariable("null")
}];
for(let i = 0; i <= 1; ++i) {
req.result.push({
id: i,
......@@ -124,7 +133,10 @@ teacherEnrollmentApp.get('/visitor', (req, res, next) => {
}, response('visitor'));
teacherEnrollmentApp.get('/ead_teacher', (req, res, next) => {
req.result = [];
req.result = [{
id: "null",
name: id2str.booleanVariable("null")
}];
for(let i = 0; i <= 1; ++i) {
req.result.push({
id: i,
......@@ -135,7 +147,10 @@ teacherEnrollmentApp.get('/ead_teacher', (req, res, next) => {
}, response('ead_teacher'));
teacherEnrollmentApp.get('/graduation_presential', (req, res, next) => {
req.result = [];
req.result = [{
id: "null",
name: id2str.booleanVariable("null")
}];
for(let i = 0; i <= 1; ++i) {
req.result.push({
id: i,
......@@ -146,7 +161,10 @@ teacherEnrollmentApp.get('/graduation_presential', (req, res, next) => {
}, response('graduation_presential'));
teacherEnrollmentApp.get('/postgraduate_ead_teacher', (req, res, next) => {
req.result = [];
req.result = [{
id: "null",
name: id2str.booleanVariable("null")
}];
for(let i = 0; i <= 1; ++i) {
req.result.push({
id: i,
......@@ -157,7 +175,10 @@ teacherEnrollmentApp.get('/postgraduate_ead_teacher', (req, res, next) => {
}, response('postgraduate_ead_teacher'));
teacherEnrollmentApp.get('/postgraduate_presential_teacher', (req, res, next) => {
req.result = [];
req.result = [{
id: "null",
name: id2str.booleanVariable("null")
}];
for(let i = 0; i <= 1; ++i) {
req.result.push({
id: i,
......@@ -168,11 +189,14 @@ teacherEnrollmentApp.get('/postgraduate_presential_teacher', (req, res, next) =>
}, response('postgraduate_presential_teacher'));
teacherEnrollmentApp.get('/deficiency', (req, res, next) => {
req.result = [];
req.result = [{
id: 9,
name: id2str.studentDeficiency(9)
}];
for(let i = 0; i <= 1; ++i) {
req.result.push({
id: i,
name: id2str.booleanVariable(i)
name: id2str.studentDeficiency(i)
});
};
next();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment