Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit cff7ce48 authored by 65160270's avatar 65160270
Browse files

update-cart

parent 47771e81
Branches
No related tags found
No related merge requests found
...@@ -53,7 +53,7 @@ router.post("/add", upload.single("image"), async (req, res) => { ...@@ -53,7 +53,7 @@ router.post("/add", upload.single("image"), async (req, res) => {
const imagePath = "/uploads/" + req.file.filename; const imagePath = "/uploads/" + req.file.filename;
// แก้จาก 'image' เป็น 'image_url' // แก้จาก '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]); [name, price, stock, imagePath]);
res.redirect("/products"); res.redirect("/products");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment