Skip to content

Commit

Permalink
fix(server): change password signup phone filed to optional (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
sulnong authored Mar 19, 2023
1 parent 0832b1e commit c35d339
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion server/src/auth/dto/passwd-signup.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
import { SmsVerifyCodeType } from '@prisma/client'
import { IsEnum, IsNotEmpty, IsString, Length, Matches } from 'class-validator'
import {
IsEnum,
IsNotEmpty,
IsOptional,
IsString,
Length,
Matches,
} from 'class-validator'

export class PasswdSignupDto {
@ApiProperty({
Expand All @@ -25,6 +32,7 @@ export class PasswdSignupDto {
description: 'phone',
example: '13805718888',
})
@IsOptional()
@IsString()
@Matches(/^1[3-9]\d{9}$/)
phone: string
Expand All @@ -33,6 +41,7 @@ export class PasswdSignupDto {
description: 'verify code',
example: '032456',
})
@IsOptional()
@IsString()
@Length(6, 6)
code: string
Expand All @@ -41,6 +50,7 @@ export class PasswdSignupDto {
description: 'type',
example: 'Signup',
})
@IsOptional()
@IsEnum(SmsVerifyCodeType)
type: SmsVerifyCodeType
}

0 comments on commit c35d339

Please sign in to comment.