We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15bef84 commit b165c79Copy full SHA for b165c79
src/cafe/dto/req/pagination.dto.ts
@@ -1,6 +1,6 @@
1
import { ApiProperty } from '@nestjs/swagger';
2
import { Type } from 'class-transformer';
3
-import { IsNumber, IsOptional } from 'class-validator';
+import { IsNumber, IsOptional, Max, Min } from 'class-validator';
4
5
export class PaginationDto {
6
@ApiProperty({
@@ -9,6 +9,7 @@ export class PaginationDto {
9
required: false,
10
})
11
@IsNumber()
12
+ @Min(1)
13
@IsOptional()
14
@Type(() => Number)
15
page: number = 1;
@@ -18,6 +19,8 @@ export class PaginationDto {
18
19
description: 'Number of pages to get(default: 20)',
20
21
22
23
+ @Max(1)
24
25
26
0 commit comments