Browse Source

Refactoring

pull/2479/head
Thomas 2 years ago
parent
commit
5d9cea3f5b
  1. 5
      apps/api/src/app/admin/admin.service.ts
  2. 2
      apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts
  3. 2
      apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.html

5
apps/api/src/app/admin/admin.service.ts

@ -46,12 +46,13 @@ export class AdminService {
symbol symbol
}: UniqueAsset & { currency?: string }): Promise<SymbolProfile | never> { }: UniqueAsset & { currency?: string }): Promise<SymbolProfile | never> {
try { try {
if (dataSource === 'MANUAL') if (dataSource === 'MANUAL') {
return await this.symbolProfileService.add({ return this.symbolProfileService.add({
currency, currency,
dataSource, dataSource,
symbol symbol
}); });
}
const assetProfiles = await this.dataProviderService.getAssetProfiles([ const assetProfiles = await this.dataProviderService.getAssetProfiles([
{ dataSource, symbol } { dataSource, symbol }

2
apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts

@ -24,7 +24,7 @@ import { AdminService } from '@ghostfolio/client/services/admin.service';
}) })
export class CreateAssetProfileDialog implements OnInit, OnDestroy { export class CreateAssetProfileDialog implements OnInit, OnDestroy {
public createAssetProfileForm: FormGroup; public createAssetProfileForm: FormGroup;
public mode: 'auto' | 'manual' = 'auto'; public mode: 'auto' | 'manual';
public constructor( public constructor(
public readonly adminService: AdminService, public readonly adminService: AdminService,

2
apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.html

@ -6,7 +6,7 @@
> >
<h1 i18n mat-dialog-title>Add Asset Profile</h1> <h1 i18n mat-dialog-title>Add Asset Profile</h1>
<div class="flex-grow-1 py-3" mat-dialog-content> <div class="flex-grow-1 py-3" mat-dialog-content>
<div class="my-2"> <div class="mb-3">
<mat-radio-group <mat-radio-group
color="primary" color="primary"
[value]="mode" [value]="mode"

Loading…
Cancel
Save