Skip to content

Commit

Permalink
fix : REST compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachid Flih authored and Rachid Flih committed Aug 1, 2024
1 parent b2179f4 commit 4803f3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions packages/api/src/@core/auth/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -86,15 +86,15 @@ 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);
}

@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);
Expand All @@ -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,
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4803f3f

Please sign in to comment.