Commit c84d0920 authored by Vytor Calixto's avatar Vytor Calixto 👾

Merge branch 'hotfix_school_code' into development

parents fc9e1c51 518123d0
Pipeline #14829 failed with stage
in 60 minutes and 5 seconds
......@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## 1.0.1 - 2018-03-15
### Changed
- Fix missing school id in teacher and class routes
## 1.0.0 - 2018-03-14
### Added
- `ReqQueryFields` middleware added to substitute parseParams and do SQL building automagically with the URL params
......
......@@ -325,7 +325,22 @@ rqfCount.addField({
type: 'boolean',
field: 'tempo_integral'
}
}).addValue({
}).addValueToField({
name: 'school',
table: 'escola',
tableField: ['nome_escola', 'id'],
resultField: ['school_name', 'school_id'],
where: {
relation: '=',
type: 'integer',
field: 'id'
},
join: {
primary: ['id', 'ano_censo'],
foreign: ['escola_id', 'ano_censo'],
foreignTable: 'turma'
}
}, 'dims').addValueToField({
name: 'school',
table: 'escola',
tableField: 'nome_escola',
......@@ -340,7 +355,7 @@ rqfCount.addField({
foreign: ['escola_id', 'ano_censo'],
foreignTable: 'turma'
}
});
}, 'filter');
classApp.get('/', rqfCount.parse(), rqfCount.build(), (req, res, next) => {
......
......@@ -296,7 +296,22 @@ rqf.addField({
foreign: 'escola_municipio_id',
foreignTable: 'docente'
}
}, 'filter').addValue({
}, 'filter').addValueToField({
name: 'school',
table: 'escola',
tableField: ['nome_escola', 'id'],
resultField: ['school_name', 'school_id'],
where: {
relation: '=',
type: 'integer',
field: 'id'
},
join: {
primary: ['id', 'ano_censo'],
foreign: ['escola_id', 'ano_censo'],
foreignTable: 'docente'
}
}, 'dims').addValueToField({
name: 'school',
table: 'escola',
tableField: 'nome_escola',
......@@ -311,7 +326,7 @@ rqf.addField({
foreign: ['escola_id', 'ano_censo'],
foreignTable: 'docente'
}
}).addValue({
}, 'filter').addValue({
name: 'location',
table: 'docente',
tableField: 'cod_localizacao',
......
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