From cec55127c8d6764af240c1e3d85b1124f3ddf56c Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 27 Jul 2024 19:45:12 +0200 Subject: [PATCH] Bugix/fix dividend import from data provider for holdings without account (#3606) * Fix dividend import for holdings without account * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/import/import.service.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 153d40a2e..4e2dcfd96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed the dividend import from a data provider for holdings without an account - Fixed an issue in the public page related to a non-existent access ## 2.97.0 - 2024-07-20 diff --git a/apps/api/src/app/import/import.service.ts b/apps/api/src/app/import/import.service.ts index 9b8668158..c5809096e 100644 --- a/apps/api/src/app/import/import.service.ts +++ b/apps/api/src/app/import/import.service.ts @@ -72,9 +72,13 @@ export class ImportService { }) ]); - const accounts = orders.map((order) => { - return order.Account; - }); + const accounts = orders + .filter(({ Account }) => { + return !!Account; + }) + .map(({ Account }) => { + return Account; + }); const Account = this.isUniqueAccount(accounts) ? accounts[0] : undefined;