From 691980bf7ce0f5706168954f152151d152521d8f Mon Sep 17 00:00:00 2001 From: noahnghg <157671712+noahnghg@users.noreply.github.com> Date: Sun, 20 Apr 2025 23:03:04 -0600 Subject: [PATCH] fix the controller again to show every transaction --- backend/controllers/transaction.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/backend/controllers/transaction.js b/backend/controllers/transaction.js index f011ee8..60592e4 100644 --- a/backend/controllers/transaction.js +++ b/backend/controllers/transaction.js @@ -68,12 +68,11 @@ exports.getTransactionsByUser = async (req, res) => { T.Date, T.PaymentStatus, P.Name AS ProductName, - MIN(I.URL) AS Image_URL + I.URL AS Image_URL FROM Transaction T JOIN Product P ON T.ProductID = P.ProductID LEFT JOIN Image_URL I ON P.ProductID = I.ProductID - WHERE T.UserID = ? - GROUP BY T.TransactionID, T.UserID, T.ProductID, T.Date, T.PaymentStatus, P.Name`, + WHERE T.UserID = ?`, [userID] );