Gitlab@Informatics

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

update-server

parent 2806694b
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ router.get('/history', isAuthenticated, async (req, res) => {
});
// แสดงรายละเอียดออเดอร์ (เฉพาะผู้ที่ Login)
router.get('/detail/:orderId', isAuthenticated, async (req, res) => {
router.get('/details/:orderId', isAuthenticated, async (req, res) => {
try {
if (!req.session.id) {
return res.status(400).json({ message: "Session ID not found. Please login again." });
......@@ -72,7 +72,10 @@ router.get('/detail/:orderId', isAuthenticated, async (req, res) => {
}
console.log("Order found:", orderResults[0]);
res.json(orderResults[0]);
// เปลี่ยนจาก `res.json(orderResults[0]);` เป็น `res.render`
res.render('order-detail', { order: orderResults[0] });
} catch (error) {
console.error("Error fetching order:", error);
res.status(500).json({ message: "Something went wrong.", error: error.message });
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment