From 9c27fb70aaaef5abe225aef024a65b9fcbcab652 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:01:53 +0100 Subject: [PATCH] Feature/minor improvements in data provider service (#4017) * Refactoring --- .../api/src/services/data-provider/data-provider.service.ts | 6 +++--- apps/client/src/app/services/data.service.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/api/src/services/data-provider/data-provider.service.ts b/apps/api/src/services/data-provider/data-provider.service.ts index c4670bc3b..bf23f96c1 100644 --- a/apps/api/src/services/data-provider/data-provider.service.ts +++ b/apps/api/src/services/data-provider/data-provider.service.ts @@ -575,8 +575,8 @@ export class DataProviderService { query: string; user: UserWithSettings; }): Promise { - const promises: Promise[] = []; let lookupItems: LookupItem[] = []; + const promises: Promise[] = []; if (query?.length < 2) { return { items: lookupItems }; @@ -606,9 +606,9 @@ export class DataProviderService { }); const filteredItems = lookupItems - .filter((lookupItem) => { + .filter(({ currency }) => { // Only allow symbols with supported currency - return lookupItem.currency ? true : false; + return currency ? true : false; }) .sort(({ name: name1 }, { name: name2 }) => { return name1?.toLowerCase().localeCompare(name2?.toLowerCase()); diff --git a/apps/client/src/app/services/data.service.ts b/apps/client/src/app/services/data.service.ts index 1d40de69c..cde7555b2 100644 --- a/apps/client/src/app/services/data.service.ts +++ b/apps/client/src/app/services/data.service.ts @@ -466,8 +466,8 @@ export class DataService { return this.http .get('/api/v1/symbol/lookup', { params }) .pipe( - map((respose) => { - return respose.items; + map(({ items }) => { + return items; }) ); }