forked from boostcampwm-2022/web05-SleepyWoods
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Validation pipe로 signupData를 유효성 검사 - signUp API 요청시 signupData 라는 객체 필수 - signupData = { nickname , characterName }
- Loading branch information
1 parent
fb46351
commit ebe4b54
Showing
4 changed files
with
41 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,43 @@ | ||
import { IsString } from 'class-validator'; | ||
import { | ||
IsNotEmpty, | ||
IsString, | ||
Matches, | ||
MaxLength, | ||
MinLength, | ||
} from 'class-validator'; | ||
import { socialPlatform } from '../user.enum'; | ||
|
||
export class UserDataDto { | ||
@IsNotEmpty() | ||
@IsString() | ||
id: string; | ||
|
||
@IsNotEmpty() | ||
@IsString() | ||
social: socialPlatform; | ||
} | ||
|
||
export class UserDataFromSocialDto { | ||
@IsNotEmpty() | ||
@IsString() | ||
id: string; | ||
|
||
@IsNotEmpty() | ||
@IsString() | ||
profileImg: string; | ||
} | ||
|
||
export class signupDataDto { | ||
@IsNotEmpty() | ||
@IsString() | ||
@MinLength(4) | ||
@MaxLength(12) | ||
@Matches(/^[a-zA-z0-9ㄱ-ㅎㅏ-ㅣ가-힣 ]*$/, { | ||
message: '특수문자는 불가합니다.', | ||
}) | ||
nickname: string; | ||
|
||
@IsNotEmpty() | ||
@IsString() | ||
characterName: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters