Closed csulit closed 5 years ago
Hi, Brad how to make the new model available to protected view?
// Dashboard router.get('/dashboard', ensureAuthenticated, (req, res) => { res.render('dashboard', { user: req.user, <-- This can be viewed phone: req.phone }) });
// Phone view router.get('/phones', ensureAuthenticated, (req, res) => { res.render('phones', { phone: req.phone <-- This one not }) });
@csulit try req.user.phone or console.log(req.user)
Hi, phone is not in the same document btw thank you for your reply i already find out how to fetch data and render to view.
Hi, Brad how to make the new model available to protected view?