1 year ago

#76637

test-img

Raphael Santos

Rendering a page with data from two tables with Sequelize

I'm making my first web dev project and I want to render a page that can access the content of two tables inside the same db, but I can't find how to do it in the documentation. I'm using PostgreSQL, express, node.js, and sequelize.

Promise
    .all(Marcas.findAll(), TiposAparelhos.findAll())
    .then((data) => {
        res.render('aparelhos/gerenciador', {
            marcas: data[0], tiposAparelhos: data[1]
        })
})    

I already tried this method but it didn't work

javascript

postgresql

sequelize.js

0 Answers

Your Answer

Accepted video resources