How to use the @nestjsx/crud.CrudValidationGroups.UPDATE function in @nestjsx/crud

To help you get started, we’ve selected a few @nestjsx/crud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github devonfw / devon4node / samples / employee / src / app / employee / model / entities / employee.entity.ts View on Github external
@IsDefined({ groups: [CrudValidationGroups.CREATE] })
  @IsOptional({ groups: [CrudValidationGroups.UPDATE] })
  @MaxLength(255)
  @Column('varchar', { length: 255, nullable: true })
  name?: string;

  @ApiModelPropertyOptional()
  @IsDefined({ groups: [CrudValidationGroups.CREATE] })
  @IsOptional({ groups: [CrudValidationGroups.UPDATE] })
  @MaxLength(255)
  @Column('varchar', { length: 255, nullable: true })
  surname?: string;

  @ApiModelPropertyOptional()
  @IsDefined({ groups: [CrudValidationGroups.CREATE] })
  @IsOptional({ groups: [CrudValidationGroups.UPDATE] })
  @MaxLength(255)
  @IsEmail()
  @Column('varchar', { length: 255, nullable: true })
  email?: string;
}