Skip to content

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

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

Thomas Kaul058d7caacdbe
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 38981a8c68..bb4e798ca2 100644
--- a/CHANGELOG.md
+++ b/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
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 7c1395a235..2e59acb01c 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
@@ -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;