Skip to content
Snippets Groups Projects
Commit 8aa5528f authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Add adm_dependency_detailed to enrollment route

parent 1c8c1eb6
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!34Db simcaq dev2
Pipeline #
......@@ -43,11 +43,19 @@ enrollmentApp.get('/education_level', (req, res, next) => {
// Returns all adm dependencies
enrollmentApp.get('/adm_dependency', (req, res, next) => {
req.sql.from('dependencia_adm')
.field('id')
.field('nome', 'name')
.where('id <= 4');
next();
}, query, response('adm_dependency'));
enrollmentApp.get('/adm_dependency_detailed', (req, res, next) => {
req.sql.from('dependencia_adm')
.field('id', 'id')
.field('nome', 'name');
next();
}, query, response('adm_dependency'));
}, query, response('adm_dependency_detailed'));
// Return genders
enrollmentApp.get('/gender', (req, res, next) => {
......@@ -94,6 +102,21 @@ rqf.addField({
foreign: 'dependencia_adm_id',
foreignTable: 'matricula'
}
}).addValue({
name: 'adm_dependency_detailed',
table: 'dependencia_adm',
tableField: 'nome',
resultField: 'adm_dependency_detailed_name',
where: {
relation: '=',
type: 'integer',
field: 'id'
},
join: {
primary: 'id',
foreign: 'dependencia_adm_priv',
foreignTable: 'matricula'
}
}).addValue({
name: 'education_level',
table: 'serie_ano',
......
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