Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 197fd21c authored by 65160394's avatar 65160394
Browse files

Project Round 8

parent aaf05a8e
Branches
No related tags found
No related merge requests found
......@@ -190,7 +190,7 @@ exports.postCreateTour = async (req, res) => {
};
exports.getEditTour = async (req, res) => {
try {
const tour = await Tour.getTourById(req.params.id);
const tour = await Tour.getTourById(req.session.userId);
if (!tour) return res.status(404).send('ไม่พบข้อมูลทัวร์');
if (tour.userId !== req.session.userId) {
return res.status(403).send('คุณไม่มีสิทธิ์แก้ไขทัวร์นี้');
......@@ -211,7 +211,7 @@ exports.postEditTour = async (req, res) => {
}
const tourData = { name, description, price, duration };
const tourId = id;
const tourId = req.session.userId;
console.log('Tour ID from URL:', tourId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment