From 55d31c2e290cba54fd1061078bcd31a3d6032d31 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 2 May 2025 14:59:05 +0200 Subject: [PATCH] Refactoring --- .../src/app/endpoints/watchlist/watchlist.service.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/api/src/app/endpoints/watchlist/watchlist.service.ts b/apps/api/src/app/endpoints/watchlist/watchlist.service.ts index 505d20323..36a498e1d 100644 --- a/apps/api/src/app/endpoints/watchlist/watchlist.service.ts +++ b/apps/api/src/app/endpoints/watchlist/watchlist.service.ts @@ -112,6 +112,10 @@ export class WatchlistService { const watchlist = await Promise.all( user.watchlist.map(async ({ dataSource, symbol }) => { + const assetProfile = assetProfiles.find((profile) => { + return profile.dataSource === dataSource && profile.symbol === symbol; + }); + const allTimeHigh = await this.marketDataService.getMax({ dataSource, symbol @@ -123,10 +127,6 @@ export class WatchlistService { quotes[symbol]?.marketPrice ); - const assetProfile = assetProfiles.find((profile) => { - return profile.dataSource === dataSource && profile.symbol === symbol; - }); - return { dataSource, symbol, @@ -135,8 +135,8 @@ export class WatchlistService { name: assetProfile?.name, performances: { allTimeHigh: { - date: allTimeHigh?.date, - performancePercent + performancePercent, + date: allTimeHigh?.date } } };