diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 2cc8bbfb8..04f96ad85 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -614,6 +614,19 @@ export class AdminService { ); } } else { + const [existingProfile] = + await this.symbolProfileService.getSymbolProfiles([ + { dataSource, symbol } + ]); + + if (!existingProfile) { + await this.addAssetProfile({ + dataSource, + symbol, + currency: currency as string + }); + } + const symbolProfileOverrides = { assetClass: assetClass as AssetClass, assetSubClass: assetSubClass as AssetSubClass, diff --git a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts index 8f956b782..33c1240a6 100644 --- a/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts +++ b/apps/client/src/app/components/admin-market-data/admin-market-data.component.ts @@ -439,7 +439,14 @@ export class GfAdminMarketDataComponent symbol, colorScheme: this.user?.settings.colorScheme, deviceType: this.deviceType, - locale: this.user?.settings?.locale + locale: this.user?.settings?.locale, + onSaved: () => { + this.loadData({ + pageIndex: this.paginator?.pageIndex ?? 0, + sortColumn: this.sort?.active, + sortDirection: this.sort?.direction + }); + } }, height: this.deviceType === 'mobile' ? '98vh' : '80vh', width: this.deviceType === 'mobile' ? '100vw' : '50rem' @@ -450,6 +457,12 @@ export class GfAdminMarketDataComponent .pipe(takeUntil(this.unsubscribeSubject)) .subscribe( (newAssetProfileIdentifier: AssetProfileIdentifier | undefined) => { + this.loadData({ + pageIndex: this.paginator?.pageIndex ?? 0, + sortColumn: this.sort?.active, + sortDirection: this.sort?.direction + }); + if (newAssetProfileIdentifier) { this.onOpenAssetProfileDialog(newAssetProfileIdentifier); } else { diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts index cbd8deba3..0467f02c6 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.component.ts @@ -582,6 +582,7 @@ export class GfAssetProfileDialogComponent implements OnDestroy, OnInit { } ); + this.data.onSaved?.(); this.initialize(); }, error: (error) => { diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/interfaces/interfaces.ts b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/interfaces/interfaces.ts index 6a966b427..5301d4844 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/interfaces/interfaces.ts +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/interfaces/interfaces.ts @@ -7,5 +7,6 @@ export interface AssetProfileDialogParams { dataSource: DataSource; deviceType: string; locale: string; + onSaved?: () => void; symbol: string; }