Browse Source

Clean up

pull/4604/head
Thomas Kaul 4 months ago
parent
commit
116fc67b04
  1. 2
      apps/api/src/app/endpoints/watchlist/watchlist.service.ts
  2. 2
      apps/client/src/app/components/home-watchlist/create-watchlist-item-dialog/create-watchlist-item-dialog.html
  3. 9
      apps/client/src/app/components/home-watchlist/home-watchlist.component.ts

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

@ -74,6 +74,6 @@ export class WatchlistService {
where: { id: userId } where: { id: userId }
}); });
return user?.watchlist ?? []; return user.watchlist ?? [];
} }
} }

2
apps/client/src/app/components/home-watchlist/create-watchlist-item-dialog/create-watchlist-item-dialog.html

@ -6,13 +6,11 @@
> >
<h1 i18n mat-dialog-title>Add Asset</h1> <h1 i18n mat-dialog-title>Add Asset</h1>
<div class="flex-grow-1 py-3" mat-dialog-content> <div class="flex-grow-1 py-3" mat-dialog-content>
<div>
<mat-form-field appearance="outline" class="w-100"> <mat-form-field appearance="outline" class="w-100">
<mat-label i18n>Name, symbol or ISIN</mat-label> <mat-label i18n>Name, symbol or ISIN</mat-label>
<gf-symbol-autocomplete formControlName="searchSymbol" /> <gf-symbol-autocomplete formControlName="searchSymbol" />
</mat-form-field> </mat-form-field>
</div> </div>
</div>
<div class="d-flex justify-content-end" mat-dialog-actions> <div class="d-flex justify-content-end" mat-dialog-actions>
<button i18n mat-button type="button" (click)="onCancel()">Cancel</button> <button i18n mat-button type="button" (click)="onCancel()">Cancel</button>
<button <button

9
apps/client/src/app/components/home-watchlist/home-watchlist.component.ts

@ -81,11 +81,11 @@ export class HomeWatchlistComponent implements OnDestroy, OnInit {
.fetchWatchlist() .fetchWatchlist()
.pipe(takeUntil(this.unsubscribeSubject)) .pipe(takeUntil(this.unsubscribeSubject))
.subscribe(({ watchlist }) => { .subscribe(({ watchlist }) => {
this.watchlist = watchlist.map((item) => ({ this.watchlist = watchlist.map(({ dataSource, symbol }) => ({
dataSource: item.dataSource, dataSource,
symbol: item.symbol, symbol,
name: item.symbol,
marketCondition: null, marketCondition: null,
name: symbol,
performances: null, performances: null,
trend200d: 'UNKNOWN', trend200d: 'UNKNOWN',
trend50d: 'UNKNOWN' trend50d: 'UNKNOWN'
@ -123,6 +123,7 @@ export class HomeWatchlistComponent implements OnDestroy, OnInit {
next: () => this.loadWatchlistData() next: () => this.loadWatchlistData()
}); });
} }
this.router.navigate(['.'], { relativeTo: this.route }); this.router.navigate(['.'], { relativeTo: this.route });
}); });
}); });

Loading…
Cancel
Save