Skip to content

Commit 6bdfd89

Browse files
authored
Bugfix/fix fetching dividend and historical market data in Financial Modeling Prep service (ghostfolio#4416)
* Add default values * Update changelog
1 parent 52081d6 commit 6bdfd89

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
### Fixed
2222

23+
- Fixed an issue to get dividends in the _Financial Modeling Prep_ service
24+
- Fixed an issue to get historical market data in the _Financial Modeling Prep_ service
2325
- Fixed an issue with serving _Storybook_
2426

2527
## 2.144.0 - 2025-03-06

apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export class FinancialModelingPrepService implements DataProviderInterface {
244244
[date: string]: IDataProviderHistoricalResponse;
245245
} = {};
246246

247-
const { historical } = await fetch(
247+
const { historical = [] } = await fetch(
248248
`${this.URL}/historical-price-full/stock_dividend/${symbol}?apikey=${this.apiKey}`,
249249
{
250250
signal: AbortSignal.timeout(requestTimeout)
@@ -305,7 +305,7 @@ export class FinancialModelingPrepService implements DataProviderInterface {
305305
? addYears(currentFrom, MAX_YEARS_PER_REQUEST)
306306
: to;
307307

308-
const { historical } = await fetch(
308+
const { historical = [] } = await fetch(
309309
`${this.URL}/historical-price-full/${symbol}?apikey=${this.apiKey}&from=${format(currentFrom, DATE_FORMAT)}&to=${format(currentTo, DATE_FORMAT)}`,
310310
{
311311
signal: AbortSignal.timeout(requestTimeout)

0 commit comments

Comments
 (0)