Browse Source

Refactoring

pull/4634/head
Thomas Kaul 4 months ago
parent
commit
d10e1d079b
  1. 11
      apps/api/src/app/endpoints/watchlist/watchlist.service.ts

11
apps/api/src/app/endpoints/watchlist/watchlist.service.ts

@ -101,15 +101,14 @@ export class WatchlistService {
where: { id: userId } where: { id: userId }
}); });
const quotes = await this.dataProviderService.getQuotes({ const [assetProfiles, quotes] = await Promise.all([
this.symbolProfileService.getSymbolProfiles(user.watchlist),
this.dataProviderService.getQuotes({
items: user.watchlist.map(({ dataSource, symbol }) => { items: user.watchlist.map(({ dataSource, symbol }) => {
return { dataSource, symbol }; return { dataSource, symbol };
}) })
}); })
]);
const assetProfiles = await this.symbolProfileService.getSymbolProfiles(
user.watchlist
);
const watchlist = await Promise.all( const watchlist = await Promise.all(
user.watchlist.map(async ({ dataSource, symbol }) => { user.watchlist.map(async ({ dataSource, symbol }) => {

Loading…
Cancel
Save