Browse Source

Clean-up code

pull/3199/head
Nicolas Fedor 1 year ago
parent
commit
28a1755686
  1. 20
      apps/api/src/app/admin/admin.service.ts

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

@ -331,7 +331,8 @@ export class AdminService {
symbol, symbol,
symbolMapping symbolMapping
}: Prisma.SymbolProfileUpdateInput & UniqueAsset) { }: Prisma.SymbolProfileUpdateInput & UniqueAsset) {
let updatedSymbolProfile: Prisma.SymbolProfileUpdateInput & UniqueAsset = { const updatedSymbolProfile: Prisma.SymbolProfileUpdateInput & UniqueAsset =
{
assetClass, assetClass,
assetSubClass, assetSubClass,
comment, comment,
@ -341,17 +342,10 @@ export class AdminService {
scraperConfiguration, scraperConfiguration,
sectors, sectors,
symbol, symbol,
symbolMapping symbolMapping,
}; ...(dataSource === 'MANUAL'
? { name }
if (dataSource === 'MANUAL') { : {
updatedSymbolProfile = {
...updatedSymbolProfile,
name
};
} else {
updatedSymbolProfile = {
...updatedSymbolProfile,
SymbolProfileOverrides: { SymbolProfileOverrides: {
upsert: { upsert: {
create: { create: {
@ -362,8 +356,8 @@ export class AdminService {
} }
} }
} }
})
}; };
}
await this.symbolProfileService.updateSymbolProfile(updatedSymbolProfile); await this.symbolProfileService.updateSymbolProfile(updatedSymbolProfile);

Loading…
Cancel
Save