feat: add field validators for username and password, and integrate them into DTOs
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { PasswordFieldValidator, UsernameFieldValidator } from '@/common/utils'
|
||||
import { ApiProperty, PartialType } from '@nestjs/swagger'
|
||||
import { IsEnum, IsOptional, IsString } from 'class-validator'
|
||||
import { PartnerRole } from 'generated/prisma/enums'
|
||||
@@ -5,9 +6,11 @@ import { PartnerRole } from 'generated/prisma/enums'
|
||||
export class CreatePartnerAccountDto {
|
||||
@IsString()
|
||||
@ApiProperty({})
|
||||
@UsernameFieldValidator()
|
||||
username: string
|
||||
|
||||
@IsString()
|
||||
@PasswordFieldValidator()
|
||||
@ApiProperty({})
|
||||
password: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user