Is there a way to combine data from two tables (dept_db, role_db) and display it on my createUsers page? I am looking for a solution where the page only needs to be rendered once to retain the previous query results. Thank you.
exports.createUsers = function (req, res, next) {
model.dept_db.findAll().then(depts => {
model.role_db.findAll().then(roles => {
res.render('createUsers', { depts: depts, roles: roles });
});
});
};