From 6341a6de6a35bde27442c141fe2595212d384ed7 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:23:13 +0100 Subject: [PATCH] Feature/refactor X-ray summary (#4116) * Refactor report statistics --- apps/api/src/app/portfolio/portfolio.service.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index d16a52544..8ead98a58 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -1677,14 +1677,14 @@ export class PortfolioService { ): PortfolioReportResponse['statistics'] { const rulesActiveCount = Object.values(evaluatedRules) .flat() - .filter(({ isActive }) => { - return isActive === true; + .filter((rule) => { + return rule?.isActive === true; }).length; const rulesFulfilledCount = Object.values(evaluatedRules) .flat() - .filter(({ value }) => { - return value === true; + .filter((rule) => { + return rule?.value === true; }).length; return { rulesActiveCount, rulesFulfilledCount };