Browse Source
Bugfix/improve error handling in position api endpoint (#607)
* Add guards
* Update changelog
pull/609/head
Thomas Kaul
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/app/portfolio/portfolio.service.ts
|
|
@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
- Hid the data provider warning while loading |
|
|
|
- Fixed an exception with the market state caused by a failed data provider request |
|
|
|
- Fixed an exception in the portfolio position endpoint |
|
|
|
- Fixed the reload of the position detail dialog (with query parameters) |
|
|
|
|
|
|
|
## 1.98.0 - 29.12.2021 |
|
|
|
|
|
@ -447,17 +447,17 @@ export class PortfolioService { |
|
|
|
// Convert investment, gross and net performance to currency of user
|
|
|
|
const userCurrency = this.request.user.Settings.currency; |
|
|
|
const investment = this.exchangeRateDataService.toCurrency( |
|
|
|
position.investment.toNumber(), |
|
|
|
position.investment?.toNumber(), |
|
|
|
currency, |
|
|
|
userCurrency |
|
|
|
); |
|
|
|
const grossPerformance = this.exchangeRateDataService.toCurrency( |
|
|
|
position.grossPerformance.toNumber(), |
|
|
|
position.grossPerformance?.toNumber(), |
|
|
|
currency, |
|
|
|
userCurrency |
|
|
|
); |
|
|
|
const netPerformance = this.exchangeRateDataService.toCurrency( |
|
|
|
position.netPerformance.toNumber(), |
|
|
|
position.netPerformance?.toNumber(), |
|
|
|
currency, |
|
|
|
userCurrency |
|
|
|
); |
|
|
|