-1
I’m having a problem where basically when inserting the data of two mysql tables in front-end I’m not getting, I think I’m reporting in the wrong way.
// Exibir post
app.get('/cad', function(req, res){
Aluno.findAll({order: [['id', 'DESC']]}).then(function(alunos){
res.render('formulario', {alunos: alunos})
})
})
app.get('/cad', function(req, res){
Post.findAll({order: [['id', 'DESC']]}).then(function(posts){
res.render('formulario', {posts: posts})
})
})
I tried this way and a few more, as shown above, sending the data prevails who comes first, in case I wanted to be sending the two at the same time, so I can be displaying the database information on the front end. Carrying out this process would be possible?
Just one question, I may be including more tables to be displayed this way?
– André Cabral
Yes, just add to the
json
in function render.– Danizavtz