Browse Source

Refactoring

pull/2002/head
Thomas 2 years ago
parent
commit
5ba4921424
  1. 10
      apps/api/src/app/benchmark/benchmark.service.ts

10
apps/api/src/app/benchmark/benchmark.service.ts

@ -212,14 +212,14 @@ export class BenchmarkService {
dataSource, dataSource,
symbol symbol
}: UniqueAsset): Promise<Partial<SymbolProfile>> { }: UniqueAsset): Promise<Partial<SymbolProfile>> {
const symbolProfile = await this.prismaService.symbolProfile.findFirst({ const assetProfile = await this.prismaService.symbolProfile.findFirst({
where: { where: {
dataSource, dataSource,
symbol symbol
} }
}); });
if (!symbolProfile) { if (!assetProfile) {
return; return;
} }
@ -228,7 +228,7 @@ export class BenchmarkService {
PROPERTY_BENCHMARKS PROPERTY_BENCHMARKS
)) as BenchmarkProperty[]) ?? []; )) as BenchmarkProperty[]) ?? [];
benchmarks.push({ symbolProfileId: symbolProfile.id }); benchmarks.push({ symbolProfileId: assetProfile.id });
benchmarks = uniqBy(benchmarks, 'symbolProfileId'); benchmarks = uniqBy(benchmarks, 'symbolProfileId');
@ -240,8 +240,8 @@ export class BenchmarkService {
return { return {
dataSource, dataSource,
symbol, symbol,
id: symbolProfile.id, id: assetProfile.id,
name: symbolProfile.name name: assetProfile.name
}; };
} }

Loading…
Cancel
Save