Use lean in more places

This commit is contained in:
Phillip Thelen
2026-01-28 20:56:29 +01:00
parent e1a68cd02a
commit b97dfdfa83
12 changed files with 20 additions and 14 deletions
+3 -1
View File
@@ -313,7 +313,9 @@ api.purchaseHistory = {
url: '/user/purchase-history',
async handler (req, res) {
const { user } = res.locals;
const transactions = await Transaction.find({ userId: user._id }).sort({ createdAt: -1 });
const transactions = await Transaction.find({ userId: user._id })
.sort({ createdAt: -1 })
.lean();
res.respond(200, transactions);
},
};