From 3615e2f0571e4c32608c1ddf39e255b0579c7352 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:58:28 +0100 Subject: [PATCH] Feature/improve handling of activities without account (#3060) * Improve handling of activities without account * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/app/portfolio/portfolio.service.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2020f58d0..b81f59c7c 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 3fafa6795..92461dce8 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;