-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#31): users could not use spaces in their character names
- Loading branch information
1 parent
99e4d40
commit 8741156
Showing
2 changed files
with
10 additions
and
6 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,8 +1,10 @@ | ||
import { IsAlpha, IsNotEmpty } from 'class-validator'; | ||
import { IsString, Matches, MaxLength, MinLength } from 'class-validator'; | ||
import { CreateUser } from '@nw-company-tool/model'; | ||
|
||
export class CreateUserDto implements CreateUser { | ||
@IsAlpha() | ||
@IsNotEmpty() | ||
@Matches(/^[a-zA-Z0-9\s]+$/) | ||
@MinLength(2) | ||
@MaxLength(24) | ||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { IsAlpha, IsNotEmpty } from 'class-validator'; | ||
import { IsString, Matches, MaxLength, MinLength } from 'class-validator'; | ||
import { SetCharacterName } from '@nw-company-tool/model'; | ||
|
||
export class SetCharacterNameDto implements SetCharacterName { | ||
@IsAlpha() | ||
@IsNotEmpty() | ||
@Matches(/^[a-zA-Z0-9\s]+$/) | ||
@MinLength(2) | ||
@MaxLength(24) | ||
@IsString() | ||
characterName: string; | ||
} |