From 4908e6d35da8715a1587085cab6f0aa9ae0faf49 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Wed, 1 Dec 2021 21:18:46 +0100 Subject: [PATCH] Bugfix/fix data gathering of fear and greed index (#505) * Fix data gathering of fear and greed index * Update changelog --- CHANGELOG.md | 6 ++++++ .../rakuten-rapid-api/rakuten-rapid-api.service.ts | 12 ++---------- libs/common/src/lib/helper.ts | 4 ---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index caf9dd8ef..3de1ee283 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Fixed the data gathering of the _Fear & Greed Index_ (market mood) + ## 1.84.0 - 30.11.2021 ### Added diff --git a/apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts b/apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts index b52cc10c4..dea52e74d 100644 --- a/apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts +++ b/apps/api/src/services/data-provider/rakuten-rapid-api/rakuten-rapid-api.service.ts @@ -2,12 +2,7 @@ import { LookupItem } from '@ghostfolio/api/app/symbol/interfaces/lookup-item.in import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; import { PrismaService } from '@ghostfolio/api/services/prisma.service'; import { ghostfolioFearAndGreedIndexSymbol } from '@ghostfolio/common/config'; -import { - DATE_FORMAT, - getToday, - getYesterday, - isRakutenRapidApiSymbol -} from '@ghostfolio/common/helper'; +import { DATE_FORMAT, getToday, getYesterday } from '@ghostfolio/common/helper'; import { Granularity } from '@ghostfolio/common/types'; import { Injectable, Logger } from '@nestjs/common'; import { DataSource } from '@prisma/client'; @@ -31,10 +26,7 @@ export class RakutenRapidApiService implements DataProviderInterface { ) {} public canHandle(symbol: string) { - return ( - isRakutenRapidApiSymbol(symbol) && - !!this.configurationService.get('RAKUTEN_RAPID_API_KEY') - ); + return !!this.configurationService.get('RAKUTEN_RAPID_API_KEY'); } public async get( diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.ts index e00568df4..7e23fce0b 100644 --- a/libs/common/src/lib/helper.ts +++ b/libs/common/src/lib/helper.ts @@ -85,10 +85,6 @@ export function isGhostfolioScraperApiSymbol(aSymbol = '') { return aSymbol.startsWith(ghostfolioScraperApiSymbolPrefix); } -export function isRakutenRapidApiSymbol(aSymbol = '') { - return aSymbol === 'GF.FEAR_AND_GREED_INDEX'; -} - export function resetHours(aDate: Date) { const year = getYear(aDate); const month = getMonth(aDate);