-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
user registration company name and password max length set for unhand…
…led error in backend
- Loading branch information
1 parent
e0d4661
commit 7e06037
Showing
1 changed file
with
23 additions
and
21 deletions.
There are no files selected for viewing
44 changes: 23 additions & 21 deletions
44
libraries/nestjs-libraries/src/dtos/auth/create.org.user.dto.ts
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,29 +1,31 @@ | ||
import {IsDefined, IsEmail, IsString, MinLength, ValidateIf} from "class-validator"; | ||
import {IsDefined, IsEmail, IsString, MaxLength, MinLength, ValidateIf} from "class-validator"; | ||
import {Provider} from '@prisma/client'; | ||
|
||
export class CreateOrgUserDto { | ||
@IsString() | ||
@MinLength(3) | ||
@IsDefined() | ||
@ValidateIf(o => !o.providerToken) | ||
password: string; | ||
@IsString() | ||
@MinLength(3) | ||
@MaxLength(64) | ||
@IsDefined() | ||
@ValidateIf((o) => !o.providerToken) | ||
password: string; | ||
|
||
@IsString() | ||
@IsDefined() | ||
provider: Provider; | ||
@IsString() | ||
@IsDefined() | ||
provider: Provider; | ||
|
||
@IsString() | ||
@IsDefined() | ||
@ValidateIf(o => !o.password) | ||
providerToken: string; | ||
@IsString() | ||
@IsDefined() | ||
@ValidateIf((o) => !o.password) | ||
providerToken: string; | ||
|
||
@IsEmail() | ||
@IsDefined() | ||
@ValidateIf(o => !o.providerToken) | ||
email: string; | ||
@IsEmail() | ||
@IsDefined() | ||
@ValidateIf((o) => !o.providerToken) | ||
email: string; | ||
|
||
@IsString() | ||
@IsDefined() | ||
@MinLength(3) | ||
company: string; | ||
@IsString() | ||
@IsDefined() | ||
@MinLength(3) | ||
@MaxLength(128) | ||
company: string; | ||
} |