From cff7ce4867758c79c9182440841ca81eaf964255 Mon Sep 17 00:00:00 2001
From: 65160270 <65160270@go.buu.ac.th>
Date: Fri, 28 Mar 2025 22:43:53 +0700
Subject: [PATCH] update-cart

---
 shop-routes/product.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shop-routes/product.js b/shop-routes/product.js
index 50870d0..5a7634b 100644
--- a/shop-routes/product.js
+++ b/shop-routes/product.js
@@ -53,7 +53,7 @@ router.post("/add", upload.single("image"), async (req, res) => {
         const imagePath = "/uploads/" + req.file.filename;
 
         // แก้จาก 'image' เป็น 'image_url'
-        await pool.execute("INSERT INTO products (name, price, stock, image_url) VALUES (?, ?, ?, ?)", 
+        await pool.execute("INSERT INTO products (name, price, stock, description, image_url) VALUES (?, ?, ?, ?)", 
             [name, price, stock, imagePath]);
 
         res.redirect("/products");
-- 
GitLab