From 117bd185054c841e9a928cedf443ae30b6e53824 Mon Sep 17 00:00:00 2001 From: Lam Ngoc Khuong Date: Fri, 6 Dec 2024 14:08:32 +0700 Subject: [PATCH] fix: pagimation validation --- src/common/dto/cursor-pagination/page-options.dto.ts | 2 +- src/common/dto/offset-pagination/page-options.dto.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/dto/cursor-pagination/page-options.dto.ts b/src/common/dto/cursor-pagination/page-options.dto.ts index 834c9bb..f0e277c 100644 --- a/src/common/dto/cursor-pagination/page-options.dto.ts +++ b/src/common/dto/cursor-pagination/page-options.dto.ts @@ -12,7 +12,7 @@ export class PageOptionsDto { beforeCursor?: string; @NumberFieldOptional({ - minimum: 1, + min: 1, default: DEFAULT_PAGE_LIMIT, int: true, }) diff --git a/src/common/dto/offset-pagination/page-options.dto.ts b/src/common/dto/offset-pagination/page-options.dto.ts index 791d52c..b128d87 100644 --- a/src/common/dto/offset-pagination/page-options.dto.ts +++ b/src/common/dto/offset-pagination/page-options.dto.ts @@ -11,14 +11,14 @@ import { export class PageOptionsDto { @NumberFieldOptional({ - minimum: 1, + min: 1, default: DEFAULT_PAGE_LIMIT, int: true, }) readonly limit?: number = DEFAULT_PAGE_LIMIT; @NumberFieldOptional({ - minimum: 1, + min: 1, default: DEFAULT_CURRENT_PAGE, int: true, })