From cfd3cd60a2ee94499c918f5431df29ca8b7c4aa0 Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Sat, 23 Oct 2021 10:21:28 +0200 Subject: [PATCH] Clean up code --- apps/api/src/app/portfolio/portfolio-calculator.ts | 8 ++++---- apps/api/src/app/portfolio/portfolio.controller.ts | 4 ++-- .../portfolio-performance.component.html | 2 +- apps/client/src/app/pages/home/home-page.component.ts | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/api/src/app/portfolio/portfolio-calculator.ts b/apps/api/src/app/portfolio/portfolio-calculator.ts index 149f02cea..bbab66874 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator.ts @@ -1,3 +1,4 @@ +import { TimelineInfoInterface } from '@ghostfolio/api/app/portfolio/interfaces/timeline-info.interface'; import { OrderType } from '@ghostfolio/api/models/order-type'; import { IDataGatheringItem } from '@ghostfolio/api/services/interfaces/interfaces'; import { DATE_FORMAT, parseDate, resetHours } from '@ghostfolio/common/helper'; @@ -29,7 +30,6 @@ import { } from './interfaces/timeline-specification.interface'; import { TransactionPointSymbol } from './interfaces/transaction-point-symbol.interface'; import { TransactionPoint } from './interfaces/transaction-point.interface'; -import { TimelineInfoInterface } from '@ghostfolio/api/app/portfolio/interfaces/timeline-info.interface'; export class PortfolioCalculator { private transactionPoints: TransactionPoint[]; @@ -369,9 +369,9 @@ export class PortfolioCalculator { ): Promise { if (timelineSpecification.length === 0) { return { - timelinePeriods: [], maxNetPerformance: new Big(0), - minNetPerformance: new Big(0) + minNetPerformance: new Big(0), + timelinePeriods: [] }; } @@ -642,8 +642,8 @@ export class PortfolioCalculator { const result = { grossPerformance, - netPerformance, investment, + netPerformance, value, date: currentDateAsString }; diff --git a/apps/api/src/app/portfolio/portfolio.controller.ts b/apps/api/src/app/portfolio/portfolio.controller.ts index 4bf4a62cf..362badb8e 100644 --- a/apps/api/src/app/portfolio/portfolio.controller.ts +++ b/apps/api/src/app/portfolio/portfolio.controller.ts @@ -131,9 +131,9 @@ export class PortfolioController { } return res.json({ + chart: chartData, isAllTimeHigh: historicalDataContainer.isAllTimeHigh, - isAllTimeLow: historicalDataContainer.isAllTimeLow, - chart: chartData + isAllTimeLow: historicalDataContainer.isAllTimeLow }); } diff --git a/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html b/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html index 27b0371b1..b2e653029 100644 --- a/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html +++ b/apps/client/src/app/components/portfolio-performance/portfolio-performance.component.html @@ -1,6 +1,6 @@