Browse Source

Extend getHistorical()

pull/5080/head
Thomas Kaul 2 months ago
parent
commit
5fd8659760
  1. 9
      apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts

9
apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts

@ -65,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
}

Loading…
Cancel
Save