From 70f7d4b1198997802bc9db38a0fbf8002f3f253d Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 3 Jul 2025 08:52:44 +0200 Subject: [PATCH] Bugfix/extend getHistorical() and getQuotes() in RapidApiService (#5080) * Extend getHistorical() * Extend getQuotes() --- .../rapid-api/rapid-api.service.ts | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts b/apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts index 05f1c0e5d..5675f1eb0 100644 --- a/apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts +++ b/apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts @@ -11,7 +11,10 @@ import { IDataProviderHistoricalResponse, IDataProviderResponse } from '@ghostfolio/api/services/interfaces/interfaces'; -import { ghostfolioFearAndGreedIndexSymbol } from '@ghostfolio/common/config'; +import { + ghostfolioFearAndGreedIndexSymbol, + ghostfolioFearAndGreedIndexSymbolStocks +} from '@ghostfolio/common/config'; import { DATE_FORMAT, getYesterday } from '@ghostfolio/common/helper'; import { DataProviderInfo, @@ -62,11 +65,16 @@ export class RapidApiService implements DataProviderInterface { [symbol: string]: { [date: string]: IDataProviderHistoricalResponse }; }> { try { - if (symbol === ghostfolioFearAndGreedIndexSymbol) { + if ( + [ + ghostfolioFearAndGreedIndexSymbol, + ghostfolioFearAndGreedIndexSymbolStocks + ].includes(symbol) + ) { const fgi = await this.getFearAndGreedIndex(); return { - [ghostfolioFearAndGreedIndexSymbol]: { + [symbol]: { [format(getYesterday(), DATE_FORMAT)]: { marketPrice: fgi.previousClose.value } @@ -99,11 +107,16 @@ export class RapidApiService implements DataProviderInterface { try { const symbol = symbols[0]; - if (symbol === ghostfolioFearAndGreedIndexSymbol) { + if ( + [ + ghostfolioFearAndGreedIndexSymbol, + ghostfolioFearAndGreedIndexSymbolStocks + ].includes(symbol) + ) { const fgi = await this.getFearAndGreedIndex(); return { - [ghostfolioFearAndGreedIndexSymbol]: { + [symbol]: { currency: undefined, dataSource: this.getName(), marketPrice: fgi.now.value,