|
|
@ -17,7 +17,10 @@ import { |
|
|
DERIVED_CURRENCIES |
|
|
DERIVED_CURRENCIES |
|
|
} from '@ghostfolio/common/config'; |
|
|
} from '@ghostfolio/common/config'; |
|
|
import { PROPERTY_DATA_SOURCES_GHOSTFOLIO_DATA_PROVIDER_MAX_REQUESTS } from '@ghostfolio/common/config'; |
|
|
import { PROPERTY_DATA_SOURCES_GHOSTFOLIO_DATA_PROVIDER_MAX_REQUESTS } from '@ghostfolio/common/config'; |
|
|
import { getAssetProfileIdentifier } from '@ghostfolio/common/helper'; |
|
|
import { |
|
|
|
|
|
getAssetProfileIdentifier, |
|
|
|
|
|
isValidSearchQuery |
|
|
|
|
|
} from '@ghostfolio/common/helper'; |
|
|
import { |
|
|
import { |
|
|
DataProviderGhostfolioAssetProfileResponse, |
|
|
DataProviderGhostfolioAssetProfileResponse, |
|
|
DataProviderHistoricalResponse, |
|
|
DataProviderHistoricalResponse, |
|
|
@ -344,7 +347,9 @@ export class GhostfolioService { |
|
|
}: GetSearchParams): Promise<LookupResponse> { |
|
|
}: GetSearchParams): Promise<LookupResponse> { |
|
|
const results: LookupResponse = { items: [] }; |
|
|
const results: LookupResponse = { items: [] }; |
|
|
|
|
|
|
|
|
if (!query) { |
|
|
query = query?.trim(); |
|
|
|
|
|
|
|
|
|
|
|
if (!isValidSearchQuery(query)) { |
|
|
return results; |
|
|
return results; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -352,10 +357,6 @@ export class GhostfolioService { |
|
|
let lookupItems: LookupItem[] = []; |
|
|
let lookupItems: LookupItem[] = []; |
|
|
const promises: Promise<{ items: LookupItem[] }>[] = []; |
|
|
const promises: Promise<{ items: LookupItem[] }>[] = []; |
|
|
|
|
|
|
|
|
if (query?.length < 2) { |
|
|
|
|
|
return { items: lookupItems }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (const dataProviderService of this.getDataProviderServices()) { |
|
|
for (const dataProviderService of this.getDataProviderServices()) { |
|
|
promises.push( |
|
|
promises.push( |
|
|
dataProviderService.search({ |
|
|
dataProviderService.search({ |
|
|
|