Browse Source

Refactoring

pull/4604/head
Thomas Kaul 4 months ago
parent
commit
6a01dc54e7
  1. 10
      apps/api/src/app/endpoints/watchlist/watchlist.controller.ts

10
apps/api/src/app/endpoints/watchlist/watchlist.controller.ts

@ -53,13 +53,13 @@ export class WatchlistController {
@Param('dataSource') dataSource: DataSource, @Param('dataSource') dataSource: DataSource,
@Param('symbol') symbol: string @Param('symbol') symbol: string
) { ) {
const watchlistItem = await this.watchlistService const watchlistItems = await this.watchlistService.getWatchlistItems(
.getWatchlistItems(this.request.user.id) this.request.user.id
.then((watchlist) => { );
return watchlist.find((item) => {
const watchlistItem = watchlistItems.find((item) => {
return item.dataSource === dataSource && item.symbol === symbol; return item.dataSource === dataSource && item.symbol === symbol;
}); });
});
if (!watchlistItem) { if (!watchlistItem) {
throw new HttpException( throw new HttpException(

Loading…
Cancel
Save