fix validazione backend
This commit is contained in:
parent
7986151af4
commit
db0253179a
@ -1,6 +1,6 @@
|
||||
import { UpdateFormRequest, UpdateInfoRequest as UpdateInfoRequestInterface } from '../interfaces';
|
||||
import { IsDate, IsNotEmpty, IsNumber, IsString, Max, MaxLength, Min, MinLength } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsBoolean, IsDate, IsNotEmpty, IsNumber, IsString, Max, MaxLength, Min, MinLength } from 'class-validator';
|
||||
import { Transform, Type } from 'class-transformer';
|
||||
import { IsAgeMatchingBirthDate } from '../validators/age-match-date-birth';
|
||||
|
||||
export class UpdateInfoRequest implements UpdateInfoRequestInterface {
|
||||
@ -24,7 +24,11 @@ export class UpdateFormValidator implements UpdateFormRequest {
|
||||
@IsAgeMatchingBirthDate({ message: "mismatch betwean date of birth and age" })
|
||||
age: number
|
||||
|
||||
married?: boolean
|
||||
|
||||
|
||||
@IsNotEmpty()
|
||||
@IsBoolean()
|
||||
married: boolean
|
||||
|
||||
@IsNotEmpty()
|
||||
@Type(() => Date)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user