Gitlab@Informatics

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

Project Round 9

parent fa141017
No related branches found
No related tags found
No related merge requests found
......@@ -210,12 +210,12 @@ exports.getEditTour = async (req, res) => {
return res.status(404).send('ไม่พบข้อมูลทัวร์');
}
// ตรวจสอบว่ามี userId ใน tour หรือไม่
if (!tour.user_Id) {
// ตรวจสอบว่ามี user_id หรือไม่
if (!tour.user_id) {
return res.status(500).send('ข้อมูลทัวร์ไม่สมบูรณ์');
}
if (tour.user_Id !== req.session.userId) {
if (tour.user_id !== req.session.userId) {
return res.status(403).send('คุณไม่มีสิทธิ์แก้ไขทัวร์นี้');
}
......@@ -226,6 +226,7 @@ exports.getEditTour = async (req, res) => {
}
};
exports.postEditTour = async (req, res) => {
const { name, description, price, duration } = req.body;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment