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