Thomas Kaul
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
5 additions and
10 deletions
-
apps/api/src/services/data-provider/coingecko/coingecko.service.ts
-
apps/api/src/services/data-provider/data-provider.service.ts
-
apps/api/src/services/data-provider/eod-historical-data/eod-historical-data.service.ts
-
apps/client/src/app/pages/portfolio/activities/create-or-update-activity-dialog/create-or-update-activity-dialog.component.ts
|
@ -163,10 +163,6 @@ export class CoinGeckoService implements DataProviderInterface { |
|
|
public async search(aQuery: string): Promise<{ items: LookupItem[] }> { |
|
|
public async search(aQuery: string): Promise<{ items: LookupItem[] }> { |
|
|
let items: LookupItem[] = []; |
|
|
let items: LookupItem[] = []; |
|
|
|
|
|
|
|
|
if (aQuery.length <= 2) { |
|
|
|
|
|
return { items }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const get = bent( |
|
|
const get = bent( |
|
|
`${this.URL}/search?query=${aQuery}`, |
|
|
`${this.URL}/search?query=${aQuery}`, |
|
|
|
@ -264,6 +264,10 @@ export class DataProviderService { |
|
|
const promises: Promise<{ items: LookupItem[] }>[] = []; |
|
|
const promises: Promise<{ items: LookupItem[] }>[] = []; |
|
|
let lookupItems: LookupItem[] = []; |
|
|
let lookupItems: LookupItem[] = []; |
|
|
|
|
|
|
|
|
|
|
|
if (aQuery?.length < 2) { |
|
|
|
|
|
return { items: lookupItems }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
for (const dataSource of this.configurationService.get('DATA_SOURCES')) { |
|
|
for (const dataSource of this.configurationService.get('DATA_SOURCES')) { |
|
|
promises.push( |
|
|
promises.push( |
|
|
this.getDataProvider(DataSource[dataSource]).search(aQuery) |
|
|
this.getDataProvider(DataSource[dataSource]).search(aQuery) |
|
|
|
@ -158,10 +158,6 @@ export class EodHistoricalDataService implements DataProviderInterface { |
|
|
public async search(aQuery: string): Promise<{ items: LookupItem[] }> { |
|
|
public async search(aQuery: string): Promise<{ items: LookupItem[] }> { |
|
|
let items: LookupItem[] = []; |
|
|
let items: LookupItem[] = []; |
|
|
|
|
|
|
|
|
if (aQuery.length <= 2) { |
|
|
|
|
|
return { items }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
const get = bent( |
|
|
const get = bent( |
|
|
`${this.URL}/search/${aQuery}?api_token=${this.apiKey}`, |
|
|
`${this.URL}/search/${aQuery}?api_token=${this.apiKey}`, |
|
|
|
@ -243,11 +243,10 @@ export class CreateOrUpdateActivityDialog implements OnDestroy { |
|
|
this.filteredLookupItemsObservable = this.activityForm.controls[ |
|
|
this.filteredLookupItemsObservable = this.activityForm.controls[ |
|
|
'searchSymbol' |
|
|
'searchSymbol' |
|
|
].valueChanges.pipe( |
|
|
].valueChanges.pipe( |
|
|
startWith(''), |
|
|
|
|
|
debounceTime(400), |
|
|
debounceTime(400), |
|
|
distinctUntilChanged(), |
|
|
distinctUntilChanged(), |
|
|
switchMap((query: string) => { |
|
|
switchMap((query: string) => { |
|
|
if (isString(query)) { |
|
|
if (isString(query) && query.length > 1) { |
|
|
const filteredLookupItemsObservable = |
|
|
const filteredLookupItemsObservable = |
|
|
this.dataService.fetchSymbols(query); |
|
|
this.dataService.fetchSymbols(query); |
|
|
|
|
|
|
|
|