diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index b2538fb6a..525273253 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -1892,9 +1892,13 @@ export class PortfolioService { }); } else { const accountIds = uniq( - orders.map(({ accountId }) => { - return accountId; - }) + orders + .filter(({ accountId }) => { + return accountId; + }) + .map(({ accountId }) => { + return accountId; + }) ); currentAccounts = await this.accountService.accounts({