Fix impersonation in performance endpoint

pull/239/head
Thomas 3 years ago
parent 71a3115fc6
commit 21570cca19

@ -236,14 +236,8 @@ export class PortfolioController {
@Query('range') range,
@Res() res: Response
): Promise<PortfolioPerformance> {
const impersonationUserId =
await this.impersonationService.validateImpersonationId(
impersonationId,
this.request.user.id
);
const performanceInformation = await this.portfolioService.getPerformance(
impersonationUserId,
impersonationId,
range
);

@ -527,12 +527,7 @@ export class PortfolioService {
aImpersonationId: string,
aDateRange: DateRange = 'max'
): Promise<{ hasErrors: boolean; performance: PortfolioPerformance }> {
const impersonationUserId =
await this.impersonationService.validateImpersonationId(
aImpersonationId,
this.request.user.id
);
const userId = impersonationUserId || this.request.user.id;
const userId = await this.getUserId(aImpersonationId);
const portfolioCalculator = new PortfolioCalculator(
this.currentRateService,

Loading…
Cancel
Save