diff --git a/Groceries/Transactions/TransactionsController.cs b/Groceries/Transactions/TransactionsController.cs index 5389cf1..2521e43 100644 --- a/Groceries/Transactions/TransactionsController.cs +++ b/Groceries/Transactions/TransactionsController.cs @@ -111,6 +111,7 @@ public class TransactionsController : Controller { var item = await dbContext.Items .Where(item => item.Barcodes.Any(barcode => barcode.BarcodeData == barcodeData)) + .OrderByDescending(item => item.UpdatedAt) .FirstOrDefaultAsync(); item ??= new Item(id: default);