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

Loading…
Cancel
Save