Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix performance chart (#119)

Thomas8e13f6ef9bfa
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ccfc789767..fa0a2b53b8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Introduced a user service implemented as an observable store (single source of truth for state)
+### Fixed
+
+- Fixed the performance chart by considering the investment
+
## 1.7.0 - 22.05.2021
### Changed
diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts
index 6ce4419074..b13f4b88be 100644
--- a/apps/api/src/app/portfolio/portfolio.service.ts
+++ b/apps/api/src/app/portfolio/portfolio.service.ts
@@ -158,8 +158,8 @@ export class PortfolioService {
return {
date: format(parseISO(portfolioItem.date), 'yyyy-MM-dd'),
grossPerformancePercent: portfolioItem.grossPerformancePercent,
- marketPrice: portfolioItem.value || null,
- value: portfolioItem.value || null
+ marketPrice: portfolioItem.value ?? null,
+ value: portfolioItem.value - portfolioItem.investment ?? null
};
});
}