Multi-environment and multi-user construction
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
MaxLength,
|
||||
Min,
|
||||
MinLength,
|
||||
ValidateIf,
|
||||
} from 'class-validator';
|
||||
|
||||
const INVITE_ROLES = ['admin', 'sales', 'support'] as const;
|
||||
@@ -27,10 +28,12 @@ export class InviteUserDto {
|
||||
@MaxLength(120)
|
||||
fullName!: string;
|
||||
|
||||
@IsOptional()
|
||||
@ValidateIf((_, value) => typeof value === 'string' && value.length > 0)
|
||||
@IsString()
|
||||
@MinLength(8)
|
||||
@MaxLength(72)
|
||||
password!: string;
|
||||
password?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsIn(INVITE_ROLES)
|
||||
|
||||
Reference in New Issue
Block a user