Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix fetching dividend and historical market data in Financial Modeling Prep service (#4416)

Thomas Kaul6bdfd8984ff9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f153f28318..579536ef75 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
+- Fixed an issue to get dividends in the _Financial Modeling Prep_ service
+- Fixed an issue to get historical market data in the _Financial Modeling Prep_ service
- Fixed an issue with serving _Storybook_
## 2.144.0 - 2025-03-06
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 2d42fe21c8..6a3d0d41f6 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
@@ -244,7 +244,7 @@ export class FinancialModelingPrepService implements DataProviderInterface {
[date: string]: IDataProviderHistoricalResponse;
} = {};
- const { historical } = await fetch(
+ const { historical = [] } = await fetch(
`${this.URL}/historical-price-full/stock_dividend/${symbol}?apikey=${this.apiKey}`,
{
signal: AbortSignal.timeout(requestTimeout)
@@ -305,7 +305,7 @@ export class FinancialModelingPrepService implements DataProviderInterface {
? addYears(currentFrom, MAX_YEARS_PER_REQUEST)
: to;
- const { historical } = await fetch(
+ const { historical = [] } = await fetch(
`${this.URL}/historical-price-full/${symbol}?apikey=${this.apiKey}&from=${format(currentFrom, DATE_FORMAT)}&to=${format(currentTo, DATE_FORMAT)}`,
{
signal: AbortSignal.timeout(requestTimeout)