Gitlab@Informatics

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

update-cart

parent 77edd60e
Branches
No related tags found
No related merge requests found
...@@ -46,6 +46,9 @@ router.post("/add", upload.single("image"), async (req, res) => { // เปล ...@@ -46,6 +46,9 @@ router.post("/add", upload.single("image"), async (req, res) => { // เปล
try { try {
const { name, price, stock, description } = req.body; // เพิ่ม description const { name, price, stock, description } = req.body; // เพิ่ม description
if (!name || !price || !stock || !description || !req.file) {
return res.status(400).send("กรุณากรอกข้อมูลให้ครบถ้วน และเลือกรูปภาพ");
}
const imagePath = "/uploads/" + req.file.filename; const imagePath = "/uploads/" + req.file.filename;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment