Gitlab@Informatics

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

update-address

parent 3fa878a2
No related branches found
No related tags found
Loading
......@@ -123,6 +123,21 @@ router.put('/detail/:orderId', isAuthenticated, async (req, res) => {
}
});
app.get('/order/confirmation', async (req, res) => {
try {
console.log("Request received:", req.query, req.body);
// ทดสอบ query database
const [orders] = await db.query("SELECT * FROM orders LIMIT 1");
console.log("Sample Order Data:", orders);
res.json({ message: "Success", data: orders });
} catch (error) {
console.error("Server Error:", error);
res.status(500).json({ message: "Something went wrong.", error: error.message });
}
});
// ป้องกันไม่ให้เข้า Checkout ถ้าไม่ได้ Login
router.get('/checkout', isAuthenticated, async (req, res) => {
try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment