File
|
email
|
Type : string
|
Decorators :
@Expose() @IsEmail() @MaxLength(255) @Transform( => )
|
|
|
|
message
|
Type : string
|
Decorators :
@Expose() @IsString() @IsNotEmpty() @MaxLength(5000) @Transform( => )
|
|
|
|
name
|
Type : string
|
Decorators :
@Expose() @IsString() @IsNotEmpty() @MaxLength(120) @Transform( => )
|
|
|
import { Exclude, Expose, Transform } from "class-transformer";
import { IsEmail, IsNotEmpty, IsString, MaxLength } from "class-validator";
@Exclude()
export class CreateContactEnquiryDto {
@Expose()
@IsString()
@IsNotEmpty()
@MaxLength(120)
@Transform(({ value }) => (typeof value === "string" ? value.trim() : value))
name!: string;
@Expose()
@IsEmail()
@MaxLength(255)
@Transform(({ value }) => (typeof value === "string" ? value.trim().toLowerCase() : value))
email!: string;
@Expose()
@IsString()
@IsNotEmpty()
@MaxLength(5000)
@Transform(({ value }) => (typeof value === "string" ? value.trim() : value))
message!: string;
}