From c011634d46fc2599dbb849bae4a839bb338be83c Mon Sep 17 00:00:00 2001 From: Hugo SUBTIL <ext.sopra.husubtil@grandlyon.com> Date: Mon, 1 Feb 2021 17:33:31 +0100 Subject: [PATCH] clean: remove unused code + console.log --- src/posts/posts.controller.ts | 6 ++---- src/users/users.controller.ts | 7 ------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/posts/posts.controller.ts b/src/posts/posts.controller.ts index 20d44db2f..01457bfd1 100644 --- a/src/posts/posts.controller.ts +++ b/src/posts/posts.controller.ts @@ -1,9 +1,8 @@ -import { Controller, Get, HttpService } from '@nestjs/common'; +import { Controller, Get, HttpService, Query } from '@nestjs/common'; import { Observable } from 'rxjs'; -import { Post } from './schemas/post.schema'; import { map } from 'rxjs/operators'; import { ApiBearerAuth, ApiQuery } from '@nestjs/swagger'; -import { Query } from '@nestjs/common'; +import { Post } from './schemas/post.schema'; @Controller('posts') export class PostsController { @@ -19,7 +18,6 @@ export class PostsController { @ApiQuery({ name: 'page', type: String, required: false }) @ApiQuery({ name: 'order', type: String, required: false }) public async findAll(@Query() query): Promise<Observable<{ posts: Post[] }>> { - console.log(query); return this.httpService .get(`${process.env.GHOST_HOST_AND_PORT}/ghost/api/v3/content/posts`, { params: { diff --git a/src/users/users.controller.ts b/src/users/users.controller.ts index 39a79d0d0..43fb564f5 100644 --- a/src/users/users.controller.ts +++ b/src/users/users.controller.ts @@ -23,7 +23,6 @@ export class UsersController { } @Post() - @ApiBearerAuth('JWT') @ApiResponse({ status: 201, description: 'User created' }) public async create(@Body() createUserDto: CreateUserDto) { // remove structureId for creation and add structure after @@ -40,7 +39,6 @@ export class UsersController { } @Post('verify/:id') - @ApiBearerAuth('JWT') @ApiParam({ name: 'id', type: String, required: true }) @ApiResponse({ status: 201, description: 'User verified' }) @ApiResponse({ status: 401, description: "This token does'nt exist or is not associate to this user." }) @@ -49,7 +47,6 @@ export class UsersController { } @UseGuards(JwtAuthGuard) - @ApiBearerAuth('JWT') @Post('change-password') @ApiResponse({ status: 201, description: 'Password changed' }) @ApiResponse({ status: 401, description: 'Invalid password' }) @@ -63,7 +60,6 @@ export class UsersController { } @UseGuards(JwtAuthGuard) - @ApiBearerAuth('JWT') @Post('change-email') @ApiResponse({ status: 201, description: 'Email confirmation send' }) @ApiResponse({ status: 401, description: 'Invalid Email' }) @@ -72,7 +68,6 @@ export class UsersController { } @UseGuards(JwtAuthGuard) - @ApiBearerAuth('JWT') @Post('verify-change-email') @ApiResponse({ status: 201, description: 'Email changed' }) @ApiResponse({ status: 401, description: 'Invalid Token' }) @@ -81,14 +76,12 @@ export class UsersController { } @Post('reset-password') - @ApiBearerAuth('JWT') @ApiResponse({ status: 200, description: 'Email sent if account exist' }) public async resetPassword(@Body() passwordReset: PasswordResetDto) { return this.usersService.sendResetPasswordEmail(passwordReset.email); } @Post('reset-password/apply') - @ApiBearerAuth('JWT') @ApiResponse({ status: 200, description: 'Email sent if account exist' }) public async resetPasswordApply(@Body() passwordResetApplyDto: PasswordResetApplyDto) { return this.usersService.validatePasswordResetToken(passwordResetApplyDto.password, passwordResetApplyDto.token); -- GitLab