Adding validator for date range strings to make sure they are ISO8601
This commit is contained in:
parent
9432210d5f
commit
13fafe9dbf
1 changed files with 3 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ import { Transform } from 'class-transformer'
|
|||
import {
|
||||
IsArray,
|
||||
IsBoolean,
|
||||
IsDateString,
|
||||
IsEnum,
|
||||
IsOptional,
|
||||
IsString,
|
||||
|
|
@ -57,10 +58,12 @@ export class CreateReservationRequest {
|
|||
readonly ownerId: string
|
||||
|
||||
@Transform(DayjsTransformer)
|
||||
@IsDateString()
|
||||
readonly dateRangeStart: Dayjs
|
||||
|
||||
@IsOptional()
|
||||
@Transform(DayjsTransformer)
|
||||
@IsDateString()
|
||||
readonly dateRangeEnd?: Dayjs
|
||||
|
||||
@IsOptional()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue