From 6a722d1bb718a808b7e75c1c5d87ec261c52f419 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 9 Nov 2023 18:03:09 +0100 Subject: [PATCH] Bugfix/fix get quotes in financial modeling prep service (#2627) * Fix get quotes * Update changelog --- CHANGELOG.md | 6 ++++++ .../financial-modeling-prep.service.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86302d454..6a8a517f5 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 an issue to get quotes in the _Financial Modeling Prep_ service + ## 2.20.0 - 2023-11-08 ### Changed diff --git a/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts b/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts index c74cfdc00..8c27f01a6 100644 --- a/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts +++ b/apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts @@ -133,7 +133,7 @@ export class FinancialModelingPrepService implements DataProviderInterface { abortController.abort(); }, requestTimeout); - const response = await got( + const quotes = await got( `${this.URL}/quote/${symbols.join(',')}?apikey=${this.apiKey}`, { // @ts-ignore @@ -141,7 +141,7 @@ export class FinancialModelingPrepService implements DataProviderInterface { } ).json(); - for (const { price, symbol } of response) { + for (const { price, symbol } of quotes) { response[symbol] = { currency: DEFAULT_CURRENCY, dataProviderInfo: this.getDataProviderInfo(),