From 2b639c509fa3d61ab2fbfc088512df9b522a79fa Mon Sep 17 00:00:00 2001
From: Atiwit Pattanapukdee <65160394@go.buu.ac.th>
Date: Tue, 18 Mar 2025 12:43:07 +0700
Subject: [PATCH] Project Round 3

---
 models/tourModel.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/models/tourModel.js b/models/tourModel.js
index ef33ee8..e19e47e 100644
--- a/models/tourModel.js
+++ b/models/tourModel.js
@@ -4,11 +4,13 @@ class Tour {
     // ดึงทัวร์ทั้งหมด
     static async getAllTours() {
       try {
+        console.log('Fetching all tours...');
         const [rows] = await pool.query('SELECT * FROM tours');
+        console.log('Tours fetched successfully:', rows);
         return rows;
       } catch (error) {
-        console.error('Error fetching tours:', error);
-        throw new Error('เกิดข้อผิดพลาดในการดึงข้อมูลทัวร์');
+        console.error('Error fetching tours:', error.message);
+        throw new Error('เกิดข้อผิดพลาดในการดึงข้อมูลทัวร์: ' + error.message);
       }
     }
   
-- 
GitLab