Skip to content

Commit

Permalink
user registration company name and password max length set for unhand…
Browse files Browse the repository at this point in the history
…led error in backend
  • Loading branch information
ArafatHossain403 committed Dec 21, 2024
1 parent e0d4661 commit 7e06037
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions libraries/nestjs-libraries/src/dtos/auth/create.org.user.dto.ts
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;
}

0 comments on commit 7e06037

Please sign in to comment.