From 9e9aea6b3bbfbf9c6227e4da462c4a6e80f577f5 Mon Sep 17 00:00:00 2001 From: 65160381 <65160381@go.buu.ac.th> Date: Tue, 25 Mar 2025 04:14:44 +0700 Subject: [PATCH] 9.9 --- app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.js b/app.js index f674a11..5760f26 100644 --- a/app.js +++ b/app.js @@ -189,8 +189,8 @@ app.get('/api/user/products', (req, res) => { // GET: ดึงข้อมูลสินค้าจากตะกร้า app.get('/api/cart', (req, res) => { - // สมมติว่ามีตะกร้าใน session ของผู้ใช้ - const cart = req.session.cart || []; // สมมติว่าใช้ session สำหรับเก็บข้อมูลตะกร้า + const cart = req.session.cart || []; // ใช้ session เก็บข้อมูลตะกร้า + console.log('Cart:', cart); // ตรวจสอบข้อมูลในตะกร้า res.json(cart); }); -- GitLab