Browse Source

Update portfolio.service.ts

pull/2569/head
Manushreshta B L 2 years ago
committed by GitHub
parent
commit
5b58770743
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      apps/api/src/app/portfolio/portfolio.service.ts

14
apps/api/src/app/portfolio/portfolio.service.ts

@ -1197,14 +1197,14 @@ export class PortfolioService {
).div(100); ).div(100);
} }
const balancesValue = await this.accountBalanceService.getAccountBalances({ const accountBalances = await this.accountBalanceService.getAccountBalances({
userId: userId userId
}); });
let totalBalance = 0; let totalBalance = 0;
balancesValue.balances.map((item) => { balancesValue.balances.map(({value) => {
totalBalance += item.value; totalBalance += value;
}); });
return { return {
@ -1221,11 +1221,11 @@ export class PortfolioService {
return { return {
date, date,
netPerformanceInPercentage, netPerformanceInPercentage,
value,
netPerformance: netPerformanceOfItem, netPerformance: netPerformanceOfItem,
totalInvestment: totalInvestmentOfItem, netWorth: value + totalBalance,
totalAccountBalance: totalBalance, totalAccountBalance: totalBalance,
netWorth: value + totalBalance totalInvestment: totalInvestmentOfItem,
value
}; };
} }
), ),

Loading…
Cancel
Save