feat: add field validators for username and password, and integrate them into DTOs
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import { PasswordFieldValidator, UsernameFieldValidator } from '@/common/utils'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
||||
import { AccountStatus, ConsumerRole } from 'generated/prisma/enums'
|
||||
|
||||
export class CreateConsumerAccountDto {
|
||||
@IsString()
|
||||
@UsernameFieldValidator()
|
||||
@ApiProperty({ required: true })
|
||||
username: string
|
||||
|
||||
@IsString()
|
||||
@PasswordFieldValidator()
|
||||
@ApiProperty({ required: true })
|
||||
password: string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user