From 4803f3f37705ad4ead258c5ef02131afd3332f56 Mon Sep 17 00:00:00 2001 From: Rachid Flih Date: Thu, 1 Aug 2024 19:58:26 +0100 Subject: [PATCH] fix : REST compliance --- packages/api/src/@core/auth/auth.controller.ts | 12 ++++++------ .../connections-strategies.controller.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/api/src/@core/auth/auth.controller.ts b/packages/api/src/@core/auth/auth.controller.ts index 29936c5b8..01bc42004 100644 --- a/packages/api/src/@core/auth/auth.controller.ts +++ b/packages/api/src/@core/auth/auth.controller.ts @@ -47,7 +47,7 @@ export class AuthController { @ApiOperation({ operationId: 'requestPasswordReset', summary: 'Request Password Reset' }) @ApiBody({ type: RequestPasswordResetDto }) - @Post('request-password-reset') + @Post('password_reset_request') async requestPasswordReset(@Body() requestPasswordResetDto: RequestPasswordResetDto) { return this.authService.requestPasswordReset(requestPasswordResetDto); } @@ -71,7 +71,7 @@ export class AuthController { @ApiOperation({ operationId: 'resetPassword', summary: 'Reset Password' }) @ApiBody({ type: ResetPasswordDto }) @ApiResponse({ status: 200, description: 'Password reset successfully' }) - @Post('reset-password') + @Post('reset_password') async resetPassword(@Body() resetPasswordDto: ResetPasswordDto) { return this.authService.resetPassword(resetPasswordDto); } @@ -86,7 +86,7 @@ export class AuthController { @ApiOperation({ operationId: 'getApiKeys', summary: 'Retrieve API Keys' }) @ApiResponse({ status: 200 }) @UseGuards(JwtAuthGuard) - @Get('api-keys') + @Get('api_keys') async getApiKeys(@Request() req: any) { const { id_project } = req.user; return this.authService.getApiKeys(id_project); @@ -94,7 +94,7 @@ export class AuthController { @ApiOperation({ operationId: 'deleteApiKey', summary: 'Delete API Keys' }) @ApiResponse({ status: 201 }) - @Delete('api-keys/:id') + @Delete('api_keys/:id') @UseGuards(JwtAuthGuard) async deleteApiKey(@Param('id') apiKeyId: string) { return await this.authService.deleteApiKey(apiKeyId); @@ -104,7 +104,7 @@ export class AuthController { @ApiBody({ type: ApiKeyDto }) @ApiResponse({ status: 201 }) @UseGuards(JwtAuthGuard) - @Post('generate-apikey') + @Post() async generateApiKey(@Body() data: ApiKeyDto): Promise<{ api_key: string }> { return this.authService.generateApiKeyForUser( data.userId, @@ -120,7 +120,7 @@ export class AuthController { @ApiBody({ type: RefreshDto }) @ApiResponse({ status: 201 }) @UseGuards(JwtAuthGuard) - @Post('refresh-token') + @Post('refresh_token') refreshAccessToken(@Request() req: any, @Body() body: RefreshDto) { const { projectId } = body; const { id_user, email, first_name, last_name } = req.user; diff --git a/packages/api/src/@core/connections-strategies/connections-strategies.controller.ts b/packages/api/src/@core/connections-strategies/connections-strategies.controller.ts index 3731a8340..209bd5445 100644 --- a/packages/api/src/@core/connections-strategies/connections-strategies.controller.ts +++ b/packages/api/src/@core/connections-strategies/connections-strategies.controller.ts @@ -23,9 +23,9 @@ import { UpdateCSDto } from './dto/update-cs.dto'; import { ConnectionStrategyCredentials } from './dto/get-connection-cs-credentials.dto'; import { JwtAuthGuard } from '@@core/auth/guards/jwt-auth.guard'; -@ApiTags('connections-strategies') +@ApiTags('connection_strategies') @ApiExcludeController() -@Controller('connections-strategies') +@Controller('connection_strategies') export class ConnectionsStrategiesController { constructor( private logger: LoggerService,