From afbe69f43b09af45c14b44148c9e8950460ba9a5 Mon Sep 17 00:00:00 2001 From: Etienne Loupias <eloupias@grandlyon.com> Date: Thu, 13 Mar 2025 14:12:10 +0100 Subject: [PATCH] get orientation pour orientation-details --- src/orientation/orientation.controller.ts | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/orientation/orientation.controller.ts b/src/orientation/orientation.controller.ts index 1c2f89af4..ad7bc24dd 100644 --- a/src/orientation/orientation.controller.ts +++ b/src/orientation/orientation.controller.ts @@ -38,6 +38,19 @@ export class OrientationController { return this.orientationService.findAll(); } + @Get('dashboard') + @UseGuards(JwtAuthGuard) + @ApiOperation({ summary: 'Get user orientations' }) + @ApiResponse({ status: 200, description: 'Return user orientations with populated details.' }) + @ApiResponse({ status: 500, description: 'Internal server error.' }) + public async getDashboard( + @Request() req, + @Query('structureId') structureId?: string + ): Promise<OrientationsDashboardDto> { + this.logger.debug(`find for user=${req.user._id}, structureId=${structureId}`); + return this.orientationService.getOrientationsDashboard(req.user._id, structureId); + } + @Get(':id') @UseGuards(JwtAuthGuard) @ApiOperation({ summary: 'Get orientation' }) @@ -53,19 +66,6 @@ export class OrientationController { return orientation; } - @Get('dashboard') - @UseGuards(JwtAuthGuard) - @ApiOperation({ summary: 'Get user orientations' }) - @ApiResponse({ status: 200, description: 'Return user orientations with populated details.' }) - @ApiResponse({ status: 500, description: 'Internal server error.' }) - public async getDashboard( - @Request() req, - @Query('structureId') structureId?: string - ): Promise<OrientationsDashboardDto> { - this.logger.debug(`find for user=${req.user._id}, structureId=${structureId}`); - return this.orientationService.getOrientationsDashboard(req.user._id, structureId); - } - @Post() @UseGuards(JwtAuthGuard) @ApiOperation({ summary: 'Save a new orientation' }) -- GitLab