diff --git a/apps/api/src/app/account/account.service.ts b/apps/api/src/app/account/account.service.ts index e72bd4f79..d8683e799 100644 --- a/apps/api/src/app/account/account.service.ts +++ b/apps/api/src/app/account/account.service.ts @@ -57,7 +57,7 @@ export class AccountService { > { const { include = {}, skip, take, cursor, where, orderBy } = params; - include.balances = { orderBy: { date: 'desc' }, take: 1 }; + include.balances = { orderBy: { createdAt: 'desc' }, take: 1 }; const accounts = await this.prismaService.account.findMany({ cursor, @@ -243,6 +243,7 @@ export class AccountService { if (amountInCurrencyOfAccount) { await this.accountBalanceService.createAccountBalance({ + date, Account: { connect: { id_userId: {