Browse Source

Respect includeIndices in search()

pull/5746/head
Thomas Kaul 3 weeks ago
parent
commit
ee2eb7b176
  1. 31
      apps/api/src/services/data-provider/financial-modeling-prep/financial-modeling-prep.service.ts

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

@ -438,6 +438,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> {
@ -484,17 +485,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