Browse Source
Refactor getCashPositions() in portfolio service (#4800)
* Refactor getCashPositions()
pull/4846/head
Thomas Kaul
4 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
3 deletions
-
apps/api/src/app/portfolio/portfolio.service.ts
|
@ -542,7 +542,7 @@ export class PortfolioService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (filters?.length === 0 || isFilteredByAccount || isFilteredByCash) { |
|
|
if (filters?.length === 0 || isFilteredByAccount || isFilteredByCash) { |
|
|
const cashPositions = await this.getCashPositions({ |
|
|
const cashPositions = this.getCashPositions({ |
|
|
cashDetails, |
|
|
cashDetails, |
|
|
userCurrency, |
|
|
userCurrency, |
|
|
value: filteredValueInBaseCurrency |
|
|
value: filteredValueInBaseCurrency |
|
@ -567,7 +567,7 @@ export class PortfolioService { |
|
|
filters[0].id === TAG_ID_EMERGENCY_FUND && |
|
|
filters[0].id === TAG_ID_EMERGENCY_FUND && |
|
|
filters[0].type === 'TAG' |
|
|
filters[0].type === 'TAG' |
|
|
) { |
|
|
) { |
|
|
const emergencyFundCashPositions = await this.getCashPositions({ |
|
|
const emergencyFundCashPositions = this.getCashPositions({ |
|
|
cashDetails, |
|
|
cashDetails, |
|
|
userCurrency, |
|
|
userCurrency, |
|
|
value: filteredValueInBaseCurrency |
|
|
value: filteredValueInBaseCurrency |
|
@ -1535,7 +1535,7 @@ export class PortfolioService { |
|
|
return { markets, marketsAdvanced }; |
|
|
return { markets, marketsAdvanced }; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private async getCashPositions({ |
|
|
private getCashPositions({ |
|
|
cashDetails, |
|
|
cashDetails, |
|
|
userCurrency, |
|
|
userCurrency, |
|
|
value |
|
|
value |
|
|