Browse Source

Bugfix/respect includeIndices flag in search functionality of FMP service (#5746)

* Respect includeIndices in search()

* Update changelog
pull/5741/merge
Thomas Kaul 4 days ago
committed by GitHub
parent
commit
058d7caacd
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 31
      apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts

4
CHANGELOG.md

@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Optimized the get quotes functionality by utilizing the asset profile resolutions in the _Financial Modeling Prep_ service
- Extracted the footer to a component
### Fixed
- Respected the include indices flag in the search functionality of the _Financial Modeling Prep_ service
## 2.208.0 - 2025-10-11
### Added

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

@ -454,6 +454,7 @@ export class FinancialModelingPrepService implements DataProviderInterface {
}
public async search({
includeIndices = false,
query,
requestTimeout = this.configurationService.get('REQUEST_TIMEOUT')
}: GetSearchParams): Promise<LookupResponse> {
@ -500,17 +501,25 @@ export class FinancialModelingPrepService implements DataProviderInterface {
}
).then((res) => res.json());
items = result.map(({ currency, name, symbol }) => {
return {
currency,
symbol,
assetClass: undefined, // TODO
assetSubClass: undefined, // TODO
dataProviderInfo: this.getDataProviderInfo(),
dataSource: this.getName(),
name: this.formatName({ name })
};
});
items = result
.filter(({ symbol }) => {
if (includeIndices === false && symbol.startsWith('^')) {
return false;
}
return true;
})
.map(({ currency, name, symbol }) => {
return {
currency,
symbol,
assetClass: undefined, // TODO
assetSubClass: undefined, // TODO
dataProviderInfo: this.getDataProviderInfo(),
dataSource: this.getName(),
name: this.formatName({ name })
};
});
}
} catch (error) {
let message = error;

Loading…
Cancel
Save