File

src/users/dto/update-data.dto.ts

Index

Properties

Properties

Public Optional email
Type : string
Decorators :
@IsEmail(undefined, {message: undefined})
@IsNotEmpty({message: undefined})
@IsOptional()
Public Optional oldPassword
Type : string
Decorators :
@IsOptional()
@IsString()
Public Optional password
Type : string
Decorators :
@MinLength(8, {message: undefined})
@MaxLength(128, {message: undefined})
@IsNotEmpty({message: undefined})
@IsOptional()
Public Optional username
Type : string
Decorators :
@IsUrlSafe()
@IsOptional()
@IsString()
import { IsUrlSafe } from '../../common/decorators/urlsafe.decorator';
import {
  IsEmail,
  IsNotEmpty,
  IsOptional,
  IsString,
  MaxLength,
  MinLength,
} from 'class-validator';
import { RegisterRespEnum } from '../../utils/enums/responses/register.enum';

export default class UpdateDataDto {
  @IsUrlSafe()
  @IsOptional()
  @IsString()
  public username?: string;

  @MinLength(8, {
    message: RegisterRespEnum.ERR_PASSWORD_TOOSHORT,
  })
  @MaxLength(128, {
    message: RegisterRespEnum.ERR_PASSWORD_TOOLONG,
  })
  @IsNotEmpty({
    message: RegisterRespEnum.ERR_PASSWORD_INVALID,
  })
  @IsOptional()
  public password?: string;

  @IsEmail(undefined, {
    message: RegisterRespEnum.ERR_INVALID_EMAIL,
  })
  @IsNotEmpty({
    message: RegisterRespEnum.ERR_INVALID_EMAIL,
  })
  @IsOptional()
  public email?: string;

  @IsOptional()
  @IsString()
  public oldPassword?: string;
}

results matching ""

    No results matching ""