diff --git a/apps/api/src/app/exchange-rate/exchange-rate.controller.ts b/apps/api/src/app/exchange-rate/exchange-rate.controller.ts index e888f8cfb..ca9b67ced 100644 --- a/apps/api/src/app/exchange-rate/exchange-rate.controller.ts +++ b/apps/api/src/app/exchange-rate/exchange-rate.controller.ts @@ -25,13 +25,13 @@ export class ExchangeRateController { ): Promise { const date = new Date(dateString); - const { marketPrice } = await this.exchangeRateService.getExchangeRate({ + const exchangeRate = await this.exchangeRateService.getExchangeRate({ date, symbol }); - if (marketPrice) { - return { marketPrice }; + if (exchangeRate) { + return { marketPrice: exchangeRate }; } throw new HttpException( diff --git a/apps/api/src/app/exchange-rate/exchange-rate.service.ts b/apps/api/src/app/exchange-rate/exchange-rate.service.ts index be7f3d55f..d340bb5b3 100644 --- a/apps/api/src/app/exchange-rate/exchange-rate.service.ts +++ b/apps/api/src/app/exchange-rate/exchange-rate.service.ts @@ -1,5 +1,4 @@ import { ExchangeRateDataService } from '@ghostfolio/api/services/exchange-rate-data.service'; -import { IDataProviderHistoricalResponse } from '@ghostfolio/api/services/interfaces/interfaces'; import { Injectable } from '@nestjs/common'; @Injectable() @@ -14,16 +13,14 @@ export class ExchangeRateService { }: { date: Date; symbol: string; - }): Promise { + }): Promise { const [currency1, currency2] = symbol.split('-'); - const marketPrice = await this.exchangeRateDataService.toCurrencyAtDate( + return this.exchangeRateDataService.toCurrencyAtDate( 1, currency1, currency2, date ); - - return { marketPrice }; } }