applied transformation on username for login

This commit is contained in:
Suman991 2026-04-17 10:50:16 +05:30
parent 8603bef573
commit 8510d4a7cb

View File

@ -1,9 +1,11 @@
import {IsNotEmpty, IsString } from 'class-validator'; import {IsNotEmpty, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
export class CreateUserDto { export class CreateUserDto {
@ApiProperty({ example: 'Jane Doe', description: 'Full name of the user' }) @ApiProperty({ example: 'Jane Doe', description: 'Full name of the user' })
@IsNotEmpty() @IsNotEmpty()
@IsString() @IsString()
@Transform(({value})=>value?.trim().toLowerCase())
name!: string; name!: string;
} }