From 2bd894ee1aea2ddacc7c3408aee788601de288d7 Mon Sep 17 00:00:00 2001 From: Tiago Rodrigues Date: Mon, 25 Mar 2024 20:07:50 +0000 Subject: [PATCH] Fix update cash balance --- apps/api/src/app/account/account.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: {