|
|
@ -278,9 +278,19 @@ export class PortfolioController {
|
|
|
|
@UseGuards(AuthGuard('jwt'))
|
|
|
|
@UseGuards(AuthGuard('jwt'))
|
|
|
|
public async getPositions(
|
|
|
|
public async getPositions(
|
|
|
|
@Headers('impersonation-id') impersonationId,
|
|
|
|
@Headers('impersonation-id') impersonationId,
|
|
|
|
@Query('range') range
|
|
|
|
@Query('range') range,
|
|
|
|
|
|
|
|
@Res() res: Response
|
|
|
|
): Promise<PortfolioPositions> {
|
|
|
|
): Promise<PortfolioPositions> {
|
|
|
|
return await this.portfolioService.getPositions(impersonationId, range);
|
|
|
|
const result = await this.portfolioService.getPositions(
|
|
|
|
|
|
|
|
impersonationId,
|
|
|
|
|
|
|
|
range
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result?.hasErrors) {
|
|
|
|
|
|
|
|
res.status(StatusCodes.ACCEPTED);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return <any>res.json(result);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Get('position/:symbol')
|
|
|
|
@Get('position/:symbol')
|
|
|
|