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 {
|
import {
|
||||||
IsArray,
|
IsArray,
|
||||||
IsBoolean,
|
IsBoolean,
|
||||||
|
IsDateString,
|
||||||
IsEnum,
|
IsEnum,
|
||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
|
|
@ -57,10 +58,12 @@ export class CreateReservationRequest {
|
||||||
readonly ownerId: string
|
readonly ownerId: string
|
||||||
|
|
||||||
@Transform(DayjsTransformer)
|
@Transform(DayjsTransformer)
|
||||||
|
@IsDateString()
|
||||||
readonly dateRangeStart: Dayjs
|
readonly dateRangeStart: Dayjs
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@Transform(DayjsTransformer)
|
@Transform(DayjsTransformer)
|
||||||
|
@IsDateString()
|
||||||
readonly dateRangeEnd?: Dayjs
|
readonly dateRangeEnd?: Dayjs
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue