fix the controller again to show every transaction

This commit is contained in:
noahnghg
2025-04-20 23:03:04 -06:00
parent 3ea45b5400
commit 691980bf7c

View File

@@ -68,12 +68,11 @@ exports.getTransactionsByUser = async (req, res) => {
T.Date, T.Date,
T.PaymentStatus, T.PaymentStatus,
P.Name AS ProductName, P.Name AS ProductName,
MIN(I.URL) AS Image_URL I.URL AS Image_URL
FROM Transaction T FROM Transaction T
JOIN Product P ON T.ProductID = P.ProductID JOIN Product P ON T.ProductID = P.ProductID
LEFT JOIN Image_URL I ON P.ProductID = I.ProductID LEFT JOIN Image_URL I ON P.ProductID = I.ProductID
WHERE T.UserID = ? WHERE T.UserID = ?`,
GROUP BY T.TransactionID, T.UserID, T.ProductID, T.Date, T.PaymentStatus, P.Name`,
[userID] [userID]
); );