Browse Source

Refactoring

pull/3117/head
Thomas Kaul 1 year ago
parent
commit
b4650deb12
  1. 3
      apps/client/src/app/components/admin-market-data-detail/admin-market-data-detail.component.ts
  2. 2
      apps/client/src/app/components/admin-market-data-detail/market-data-detail-dialog/interfaces/interfaces.ts
  3. 4
      apps/client/src/app/components/admin-market-data-detail/market-data-detail-dialog/market-data-detail-dialog.component.ts
  4. 2
      apps/client/src/app/components/admin-market-data-detail/market-data-detail-dialog/market-data-detail-dialog.html
  5. 6
      apps/client/src/app/services/admin.service.ts

3
apps/client/src/app/components/admin-market-data-detail/admin-market-data-detail.component.ts

@ -155,12 +155,11 @@ export class AdminMarketDataDetailComponent implements OnChanges, OnInit {
day: string;
yearMonth: string;
}) {
const date = `${yearMonth}-${day}`;
const marketPrice = this.marketDataByMonth[yearMonth]?.[day]?.marketPrice;
const dialogRef = this.dialog.open(MarketDataDetailDialog, {
data: <MarketDataDetailDialogParams>{
date,
dateString: `${yearMonth}-${day}`,
marketPrice,
currency: this.currency,
dataSource: this.dataSource,

2
apps/client/src/app/components/admin-market-data-detail/market-data-detail-dialog/interfaces/interfaces.ts

@ -5,7 +5,7 @@ import { DataSource } from '@prisma/client';
export interface MarketDataDetailDialogParams {
currency: string;
dataSource: DataSource;
date: string;
dateString: string;
marketPrice: number;
symbol: string;
user: User;

4
apps/client/src/app/components/admin-market-data-detail/market-data-detail-dialog/market-data-detail-dialog.component.ts

@ -45,7 +45,7 @@ export class MarketDataDetailDialog implements OnDestroy {
this.adminService
.fetchSymbolForDate({
dataSource: this.data.dataSource,
date: this.data.date,
dateString: this.data.dateString,
symbol: this.data.symbol
})
.pipe(takeUntil(this.unsubscribeSubject))
@ -63,7 +63,7 @@ export class MarketDataDetailDialog implements OnDestroy {
marketData: {
marketData: [
{
date: this.data.date,
date: this.data.dateString,
marketPrice: this.data.marketPrice
}
]

2
apps/client/src/app/components/admin-market-data-detail/market-data-detail-dialog/market-data-detail-dialog.html

@ -9,7 +9,7 @@
matInput
name="date"
[matDatepicker]="date"
[(ngModel)]="data.date"
[(ngModel)]="data.dateString"
/>
<mat-datepicker-toggle class="mr-2" matSuffix [for]="date">
<ion-icon

6
apps/client/src/app/services/admin.service.ts

@ -188,14 +188,14 @@ export class AdminService {
public fetchSymbolForDate({
dataSource,
date,
dateString,
symbol
}: {
dataSource: DataSource;
date: string;
dateString: string;
symbol: string;
}) {
const url = `/api/v1/symbol/${dataSource}/${symbol}/${date}`;
const url = `/api/v1/symbol/${dataSource}/${symbol}/${dateString}`;
return this.http.get<IDataProviderHistoricalResponse>(url);
}

Loading…
Cancel
Save