diff --git a/src/project/controllers/project.controller.ts b/src/project/controllers/project.controller.ts index 24d5a44..3b2de61 100644 --- a/src/project/controllers/project.controller.ts +++ b/src/project/controllers/project.controller.ts @@ -1,4 +1,6 @@ import { ControllerRoute } from '@app/common/constants/controller-route'; +import { BaseResponseDto } from '@app/common/dto/base.response.dto'; +import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard'; import { Body, Controller, @@ -13,7 +15,6 @@ import { Res, UseGuards, } from '@nestjs/common'; -import { Response } from 'express'; import { ApiBearerAuth, ApiOperation, @@ -21,11 +22,10 @@ import { ApiResponse, ApiTags, } from '@nestjs/swagger'; -import { ProjectService } from '../services'; +import { Response } from 'express'; import { CreateProjectDto, GetProjectParam } from '../dto'; -import { BaseResponseDto } from '@app/common/dto/base.response.dto'; -import { JwtAuthGuard } from '@app/common/guards/jwt.auth.guard'; -import { PaginationRequestGetListDto } from '@app/common/dto/pagination.request.dto'; +import { ListProjectsDto } from '../dto/list-project.dto'; +import { ProjectService } from '../services'; @ApiTags('Project Module') @Controller({ @@ -80,9 +80,7 @@ export class ProjectController { description: ControllerRoute.PROJECT.ACTIONS.LIST_PROJECTS_DESCRIPTION, }) @Get() - async list( - @Query() query: PaginationRequestGetListDto, - ): Promise { + async list(@Query() query: ListProjectsDto): Promise { return this.projectService.listProjects(query); } diff --git a/src/project/dto/list-project.dto.ts b/src/project/dto/list-project.dto.ts new file mode 100644 index 0000000..344c8c4 --- /dev/null +++ b/src/project/dto/list-project.dto.ts @@ -0,0 +1,7 @@ +import { PaginationRequestGetListDto } from '@app/common/dto/pagination.request.dto'; +import { PickType } from '@nestjs/swagger'; + +export class ListProjectsDto extends PickType(PaginationRequestGetListDto, [ + 'page', + 'size', +]) {}