Browse Source

Fix update cash balance

pull/3193/head
Tiago Rodrigues 1 year ago
parent
commit
2bd894ee1a
  1. 3
      apps/api/src/app/account/account.service.ts

3
apps/api/src/app/account/account.service.ts

@ -57,7 +57,7 @@ export class AccountService {
> { > {
const { include = {}, skip, take, cursor, where, orderBy } = params; 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({ const accounts = await this.prismaService.account.findMany({
cursor, cursor,
@ -243,6 +243,7 @@ export class AccountService {
if (amountInCurrencyOfAccount) { if (amountInCurrencyOfAccount) {
await this.accountBalanceService.createAccountBalance({ await this.accountBalanceService.createAccountBalance({
date,
Account: { Account: {
connect: { connect: {
id_userId: { id_userId: {

Loading…
Cancel
Save