Browse Source

Refactoring

pull/5771/head
Thomas Kaul 2 weeks ago
parent
commit
6c69ba1904
  1. 8
      apps/api/src/app/endpoints/benchmarks/benchmarks.service.ts
  2. 2
      apps/client/src/app/services/data.service.ts

8
apps/api/src/app/endpoints/benchmarks/benchmarks.service.ts

@ -4,7 +4,11 @@ import { BenchmarkService } from '@ghostfolio/api/services/benchmark/benchmark.s
import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.service';
import { MarketDataService } from '@ghostfolio/api/services/market-data/market-data.service';
import { DATE_FORMAT, parseDate, resetHours } from '@ghostfolio/common/helper';
import { AssetProfileIdentifier, Filter } from '@ghostfolio/common/interfaces';
import {
AssetProfileIdentifier,
BenchmarkMarketDataDetailsResponse,
Filter
} from '@ghostfolio/common/interfaces';
import { DateRange, UserWithSettings } from '@ghostfolio/common/types';
import { Injectable, Logger } from '@nestjs/common';
@ -39,7 +43,7 @@ export class BenchmarksService {
startDate: Date;
user: UserWithSettings;
withExcludedAccounts?: boolean;
} & AssetProfileIdentifier) {
} & AssetProfileIdentifier): Promise<BenchmarkMarketDataDetailsResponse> {
const marketData: { date: string; value: number }[] = [];
const userCurrency = user.settings.settings.baseCurrency;
const userId = user.id;

2
apps/client/src/app/services/data.service.ts

@ -365,7 +365,7 @@ export class DataService {
range: DateRange;
startDate: Date;
withExcludedAccounts?: boolean;
} & AssetProfileIdentifier): Observable<BenchmarkMarketDataDetailsResponse> {
} & AssetProfileIdentifier) {
let params = this.buildFiltersAsQueryParams({ filters });
params = params.append('range', range);

Loading…
Cancel
Save