Fix impersonation in performance endpoint
This commit is contained in:
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…
x
Reference in New Issue
Block a user