Commit 1a9e57ba authored by ns17's avatar ns17

Merge branch 'cursos_licenciatura' of...

Merge branch 'cursos_licenciatura' of https://gitlab.c3sl.ufpr.br/simcaq/simcaq-node into cursos_licenciatura
parents ad691136 3c1d2504
Pipeline #24107 failed with stage
in 2 minutes and 2 seconds
......@@ -623,21 +623,32 @@ disciplinesApp.get('/', rqf.parse(), (req, res, next) => {
}
else { */}
let disciplinesNotSuitable = [];
let disciplinesSuitable = [];
let disciplinesSuitable = [];
req.result.forEach((r) => {
let objNotSuitable = {
total: parseInt(r.total) - parseInt(r.total_suitable),
suitable: 0
total: 0,
discipline_id: 0,
discipline_name: "formação não adequada"
}
let objSuitable = {
total: parseInt(r.total_suitable),
suitable: 1
}
total: 0,
discipline_id: 1,
discipline_name: "formação adequada"
}
Object.keys(r).forEach(k => {
if (k !== 'total' && k !== 'total_suitable') {
objNotSuitable[k] = r[k];
let subject = k.split('_')
if (subject[0] == "total"){
if (subject[1] == "suitable")
objSuitable.total += parseInt(r[k])
else
objNotSuitable.total += parseInt(r[k])
}
objNotSuitable[k] = r[k];
objSuitable[k] = r[k];
}
})
......
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