diff --git a/CHANGELOG.md b/CHANGELOG.md index 2020f58d..b81f59c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed + +- Improved the handling of activities without account + ### Fixed - Fixed the query to filter activities of excluded accounts diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 3fafa679..92461dce 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -749,7 +749,9 @@ export class PortfolioService { } = position; const accounts: PortfolioPositionDetail['accounts'] = uniqBy( - orders, + orders.filter(({ Account }) => { + return Account; + }), 'Account.id' ).map(({ Account }) => { return Account;