Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 040b126e authored by 65160394's avatar 65160394
Browse files

Project Round 2

parent e93eaa35
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,10 @@ const { User, Tour } = require('../models/tourModel');
exports.getTours = async (req, res) => {
try {
const tours = await Tour.getAllTours();
res.render('index', { tours });
res.render('index', {
tours: tours,
session: req.session // ส่ง session ไปยัง ejs
});
} catch (error) {
res.status(500).send('เกิดข้อผิดพลาด');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment