File

apps/api/src/users/dto/patch-user.dto.ts

Description

Patch User Payload Class

Index

Properties

Properties

email
Type : string
Decorators :
@ApiProperty()
@IsEmail()
@IsNotEmpty()

Email field

name
Type : string
Decorators :
@ApiProperty()
@Matches(/^[a-zA-Z ]+$/)
@IsNotEmpty()

Name field

password
Type : string
Decorators :
@ApiProperty()
@IsNotEmpty()
@MinLength(8)

Password field

username
Type : string
Decorators :
@ApiProperty({required: true})
@IsAlphanumeric()
@IsNotEmpty()

Username field

import { ApiProperty } from '@nestjs/swagger';
import {
  IsAlphanumeric,
  IsEmail,
  IsNotEmpty,
  Matches,
  MinLength,
} from 'class-validator';

/**
 * Patch User Payload Class
 */
export class PatchUserDto {
  /**
   * Email field
   */
  @ApiProperty()
  @IsEmail()
  @IsNotEmpty()
  email: string;

  /**
   * Username field
   */
  @ApiProperty({
    required: true,
  })
  @IsAlphanumeric()
  @IsNotEmpty()
  username: string;

  /**
   * Name field
   */
  @ApiProperty()
  @Matches(/^[a-zA-Z ]+$/)
  @IsNotEmpty()
  name: string;

  /**
   * Password field
   */
  @ApiProperty()
  @IsNotEmpty()
  @MinLength(8)
  password: string;
}

results matching ""

    No results matching ""