diff --git a/src/Purrse.Api/Services/DashboardService.cs b/src/Purrse.Api/Services/DashboardService.cs index 54fb0ec..80e10eb 100644 --- a/src/Purrse.Api/Services/DashboardService.cs +++ b/src/Purrse.Api/Services/DashboardService.cs @@ -55,7 +55,7 @@ public class DashboardService : IDashboardService .Include(t => t.Category) .Where(t => t.Account.UserId == userId && t.Date >= startOfMonth && t.Amount < 0 && !t.IsVoid && t.CategoryId.HasValue) .GroupBy(t => new { t.CategoryId, CategoryName = t.Category!.Name }) - .Select(g => new CategorySpending(g.Key.CategoryName, Math.Abs(g.Sum(t => t.Amount)), 0, null)) + .Select(g => new CategorySpending(g.Key.CategoryName, -g.Sum(t => t.Amount), 0, null)) .OrderByDescending(c => c.Amount) .Take(5) .ToListAsync();