Skip to content

Commit

Permalink
fix: adjust swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
William Koller committed Apr 27, 2022
1 parent 02418cd commit 0683e72
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/doc/swagger.doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const swagger = (app: NestExpressApplication): void => {
.addTag('auth')
.addTag('books')
.addTag('users')
.addBasicAuth()
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api/docs', app, document);
Expand Down
4 changes: 2 additions & 2 deletions src/modules/books/controllers/books.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ import { FindByIdBookService } from '@/modules/books/services/find-by-id/find-by
import { UpdateBookDto } from '@/modules/books/dtos/update-book.dto';
import { UpdateBookService } from '@/modules/books/services/update-book/update-book.service';
import { DeleteBookService } from '@/modules/books/services/delete-book/delete-book.service';
import { ApiBasicAuth, ApiResponse, ApiTags } from '@nestjs/swagger';
import { ApiBearerAuth, ApiResponse, ApiTags } from '@nestjs/swagger';
import { JwtAuthGuard } from '@/modules/auth/guards/auth.guard';
import { Cache } from 'cache-manager';
import { ProcessBook } from '../process/books.process';

@ApiTags('books')
@ApiBasicAuth()
@ApiBearerAuth()
@Controller('books')
@UseGuards(JwtAuthGuard)
export class BooksController {
Expand Down
8 changes: 4 additions & 4 deletions src/modules/users/controllers/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { User } from '@/modules/users/schemas/user.schema';
import { AddUserService } from '@/modules/users/services/add-user/add-user.service';
import { FindAllUsersService } from '../services/find-all-users/find-all-users.service';
import { FindUserByIdService } from '../services/find-user-by-id/find-user-by-id.service';
import { ApiBasicAuth, ApiResponse, ApiTags } from '@nestjs/swagger';
import { ApiBearerAuth, ApiResponse, ApiTags } from '@nestjs/swagger';
import { JwtAuthGuard } from '@/modules/auth/guards/auth.guard';
import { FileInterceptor } from '@nestjs/platform-express';
import { UploadAvatarService } from '../services/upload-avatar/upload-avatar.service';
Expand Down Expand Up @@ -43,7 +43,7 @@ export class UsersController {
}

@Get()
@ApiBasicAuth()
@ApiBearerAuth()
@ApiResponse({
status: HttpStatus.OK,
description: 'find all users.',
Expand All @@ -58,7 +58,7 @@ export class UsersController {
}

@Get(':_id')
@ApiBasicAuth()
@ApiBearerAuth()
@ApiResponse({
status: HttpStatus.OK,
description: 'find users by id.',
Expand All @@ -73,7 +73,7 @@ export class UsersController {
}

@Post('/:_id/upload')
@ApiBasicAuth()
@ApiBearerAuth()
@ApiResponse({
status: HttpStatus.OK,
description: 'upload file S3',
Expand Down

0 comments on commit 0683e72

Please sign in to comment.