Browse Source

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

* Respect includeIndices in search()

* Update changelog
pull/5741/merge
Thomas Kaul 5 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 - Optimized the get quotes functionality by utilizing the asset profile resolutions in the _Financial Modeling Prep_ service
- Extracted the footer to a component - 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 ## 2.208.0 - 2025-10-11
### Added ### 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({ public async search({
includeIndices = false,
query, query,
requestTimeout = this.configurationService.get('REQUEST_TIMEOUT') requestTimeout = this.configurationService.get('REQUEST_TIMEOUT')
}: GetSearchParams): Promise<LookupResponse> { }: GetSearchParams): Promise<LookupResponse> {
@ -500,17 +501,25 @@ export class FinancialModelingPrepService implements DataProviderInterface {
} }
).then((res) => res.json()); ).then((res) => res.json());
items = result.map(({ currency, name, symbol }) => { items = result
return { .filter(({ symbol }) => {
currency, if (includeIndices === false && symbol.startsWith('^')) {
symbol, return false;
assetClass: undefined, // TODO }
assetSubClass: undefined, // TODO
dataProviderInfo: this.getDataProviderInfo(), return true;
dataSource: this.getName(), })
name: this.formatName({ name }) .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) { } catch (error) {
let message = error; let message = error;

Loading…
Cancel
Save