Add pagination dto
This commit is contained in:
parent
98f4e451a9
commit
ab5bb50d7b
1 changed files with 15 additions and 0 deletions
15
src/pagination.dto.ts
Normal file
15
src/pagination.dto.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { Type } from "class-transformer";
|
||||
import { IsNumber, IsOptional, Min } from "class-validator";
|
||||
|
||||
export class PaginationDto {
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
@Type(() => Number)
|
||||
@Min(1)
|
||||
page?: number = 1;
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
@Type(() => Number)
|
||||
@Min(1)
|
||||
limit?: number = 1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue