Skip to content

Commit e2353ec

Browse files
committed
feat(query-rest): Add IsDate validation to field decorator
1 parent 1a33964 commit e2353ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/query-rest/src/decorators/field.decorator.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ApiProperty, ApiPropertyOptions } from '@nestjs/swagger'
33
import { Expose, Transform, Type } from 'class-transformer'
44
import {
55
ArrayMaxSize,
6+
IsDate,
67
IsEnum,
78
IsNotEmpty,
89
IsNumber,
@@ -137,6 +138,8 @@ export function Field(
137138
decorators.push(IsString())
138139
} else if (type === Number) {
139140
decorators.push(IsNumber())
141+
} else if (type === Date) {
142+
decorators.push(IsDate())
140143
}
141144

142145
if (returnTypeFunc && typeof type === 'function') {

0 commit comments

Comments
 (0)