🐛 Fix wallet queries

This commit is contained in:
2026-02-04 12:07:26 +08:00
parent 7f8aff20d3
commit e86f630024
2 changed files with 0 additions and 14 deletions

View File

@@ -506,10 +506,6 @@ public class PaymentService(
// Load the fund with account data including profiles // Load the fund with account data including profiles
var createdFund = await db.WalletFunds var createdFund = await db.WalletFunds
.Include(f => f.Recipients) .Include(f => f.Recipients)
.ThenInclude(r => r.RecipientAccount)
.ThenInclude(a => a.Profile)
.Include(f => f.CreatorAccount)
.ThenInclude(a => a.Profile)
.FirstOrDefaultAsync(f => f.Id == fund.Id); .FirstOrDefaultAsync(f => f.Id == fund.Id);
return createdFund!; return createdFund!;
@@ -751,10 +747,6 @@ public class PaymentService(
{ {
var fund = await db.WalletFunds var fund = await db.WalletFunds
.Include(f => f.Recipients) .Include(f => f.Recipients)
.ThenInclude(r => r.RecipientAccount)
.ThenInclude(a => a.Profile)
.Include(f => f.CreatorAccount)
.ThenInclude(a => a.Profile)
.FirstOrDefaultAsync(f => f.Id == fundId); .FirstOrDefaultAsync(f => f.Id == fundId);
if (fund == null) if (fund == null)

View File

@@ -137,9 +137,7 @@ public class WalletController(
.Skip(offset) .Skip(offset)
.Take(take) .Take(take)
.Include(t => t.PayerWallet) .Include(t => t.PayerWallet)
.ThenInclude(w => w!.Account)
.Include(t => t.PayeeWallet) .Include(t => t.PayeeWallet)
.ThenInclude(w => w!.Account)
.ToListAsync(); .ToListAsync();
return Ok(transactions); return Ok(transactions);
@@ -300,8 +298,6 @@ public class WalletController(
var currentUserId = Guid.Parse(currentUser.Id); var currentUserId = Guid.Parse(currentUser.Id);
var query = db.WalletFunds var query = db.WalletFunds
.Include(f => f.Recipients) .Include(f => f.Recipients)
.ThenInclude(r => r.RecipientAccount)
.Include(f => f.CreatorAccount)
.Where(f => f.CreatorAccountId == currentUserId || .Where(f => f.CreatorAccountId == currentUserId ||
f.Recipients.Any(r => r.RecipientAccountId == currentUserId)) f.Recipients.Any(r => r.RecipientAccountId == currentUserId))
.AsQueryable(); .AsQueryable();
@@ -328,8 +324,6 @@ public class WalletController(
{ {
var fund = await db.WalletFunds var fund = await db.WalletFunds
.Include(f => f.Recipients) .Include(f => f.Recipients)
.ThenInclude(r => r.RecipientAccount)
.Include(f => f.CreatorAccount)
.FirstOrDefaultAsync(f => f.Id == id); .FirstOrDefaultAsync(f => f.Id == id);
if (fund is null) if (fund is null)