Browse Source

Task/improve promises in patchAssetProfileData() of admin service (#6938)

Improve promises in patchAssetProfileData()
pull/6940/head
Thomas Kaul 1 day ago
committed by GitHub
parent
commit
dcbd9225da
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 36
      apps/api/src/app/admin/admin.service.ts

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

@ -576,8 +576,8 @@ export class AdminService {
}
try {
Promise.all([
await this.symbolProfileService.updateAssetProfileIdentifier(
await Promise.all([
this.symbolProfileService.updateAssetProfileIdentifier(
{
dataSource,
symbol
@ -587,7 +587,7 @@ export class AdminService {
symbol: newSymbol as string
}
),
await this.marketDataService.updateAssetProfileIdentifier(
this.marketDataService.updateAssetProfileIdentifier(
{
dataSource,
symbol
@ -599,12 +599,15 @@ export class AdminService {
)
]);
return this.symbolProfileService.getSymbolProfiles([
{
dataSource: DataSource[newDataSource.toString()],
symbol: newSymbol as string
}
])?.[0];
const [updatedAssetProfile] =
await this.symbolProfileService.getSymbolProfiles([
{
dataSource: DataSource[newDataSource.toString()],
symbol: newSymbol as string
}
]);
return updatedAssetProfile;
} catch {
throw new HttpException(
getReasonPhrase(StatusCodes.BAD_REQUEST),
@ -650,12 +653,15 @@ export class AdminService {
updatedSymbolProfile
);
return this.symbolProfileService.getSymbolProfiles([
{
dataSource: dataSource as DataSource,
symbol: symbol as string
}
])?.[0];
const [updatedAssetProfile] =
await this.symbolProfileService.getSymbolProfiles([
{
dataSource: dataSource as DataSource,
symbol: symbol as string
}
]);
return updatedAssetProfile;
}
}

Loading…
Cancel
Save