From d10e1d079b21850c0603ef2099b83f64b2bd4862 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 2 May 2025 14:56:16 +0200 Subject: [PATCH] Refactoring --- .../app/endpoints/watchlist/watchlist.service.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/api/src/app/endpoints/watchlist/watchlist.service.ts b/apps/api/src/app/endpoints/watchlist/watchlist.service.ts index b5c6da4f7..505d20323 100644 --- a/apps/api/src/app/endpoints/watchlist/watchlist.service.ts +++ b/apps/api/src/app/endpoints/watchlist/watchlist.service.ts @@ -101,15 +101,14 @@ export class WatchlistService { where: { id: userId } }); - const quotes = await this.dataProviderService.getQuotes({ - items: user.watchlist.map(({ dataSource, symbol }) => { - return { dataSource, symbol }; + const [assetProfiles, quotes] = await Promise.all([ + this.symbolProfileService.getSymbolProfiles(user.watchlist), + this.dataProviderService.getQuotes({ + items: user.watchlist.map(({ dataSource, symbol }) => { + return { dataSource, symbol }; + }) }) - }); - - const assetProfiles = await this.symbolProfileService.getSymbolProfiles( - user.watchlist - ); + ]); const watchlist = await Promise.all( user.watchlist.map(async ({ dataSource, symbol }) => {