Commit e2bb9772 authored by Odair M.'s avatar Odair M.

Merge branch 'fix-curso-search' into 'development'

arruma pesquisa por curso

See merge request !41
parents 237e571d 2d383b16
......@@ -8,10 +8,10 @@ module.exports = function(Curso) {
//todas as turmas de todo o curso.
//como o é utilizado somente o código da sala, não precisa incluir a
//relacao sala
var _include = {disciplinas:{turmas:["professor", "horarios"]}}
var _include = {turmas:["professor","disciplina","horarios"]}
var cursos = await app.models.Curso.find({where:
{or: [{nome: _query},
{codigo: _query}]}})
{codigo: _query}]}, include:_include})
// for(var i = 0; i < cursos.length; i++) {
//
// }
......
......@@ -35,6 +35,11 @@
"disciplinas": {
"type": "hasAndBelongsToMany",
"model": "Disciplina"
},
"turmas": {
"type": "hasMany",
"model": "Turma",
"foreignKey": "cursoCod"
}
},
"acls": [
......
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