diff --git a/apps/api/src/app/admin/admin.service.ts b/apps/api/src/app/admin/admin.service.ts index 06ccdf379..fe40a299a 100644 --- a/apps/api/src/app/admin/admin.service.ts +++ b/apps/api/src/app/admin/admin.service.ts @@ -331,19 +331,41 @@ export class AdminService { symbol, symbolMapping }: Prisma.SymbolProfileUpdateInput & UniqueAsset) { - await this.symbolProfileService.updateSymbolProfile({ + let updatedSymbolProfile: Prisma.SymbolProfileUpdateInput & UniqueAsset = { assetClass, assetSubClass, comment, countries, currency, dataSource, - name, scraperConfiguration, sectors, symbol, symbolMapping - }); + }; + + if (dataSource === 'MANUAL') { + updatedSymbolProfile = { + ...updatedSymbolProfile, + name + }; + } else { + updatedSymbolProfile = { + ...updatedSymbolProfile, + SymbolProfileOverrides: { + upsert: { + create: { + name: name as string + }, + update: { + name: name as string + } + } + } + }; + } + + await this.symbolProfileService.updateSymbolProfile(updatedSymbolProfile); const [symbolProfile] = await this.symbolProfileService.getSymbolProfiles([ { diff --git a/apps/api/src/services/symbol-profile/symbol-profile.service.ts b/apps/api/src/services/symbol-profile/symbol-profile.service.ts index 751feda22..656b7b7e4 100644 --- a/apps/api/src/services/symbol-profile/symbol-profile.service.ts +++ b/apps/api/src/services/symbol-profile/symbol-profile.service.ts @@ -97,7 +97,8 @@ export class SymbolProfileService { scraperConfiguration, sectors, symbol, - symbolMapping + symbolMapping, + SymbolProfileOverrides }: Prisma.SymbolProfileUpdateInput & UniqueAsset) { return this.prismaService.symbolProfile.update({ data: { @@ -109,7 +110,8 @@ export class SymbolProfileService { name, scraperConfiguration, sectors, - symbolMapping + symbolMapping, + SymbolProfileOverrides }, where: { dataSource_symbol: { dataSource, symbol } } }); diff --git a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html index e1695ef6d..51397fe26 100644 --- a/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html +++ b/apps/client/src/app/components/admin-market-data/asset-profile-dialog/asset-profile-dialog.html @@ -205,7 +205,7 @@ } -