Skip to content

Instantly share code, notes, and snippets.

@gmwill934
Created January 14, 2021 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmwill934/c3c68650f773018aa8c656697ea2c625 to your computer and use it in GitHub Desktop.
Save gmwill934/c3c68650f773018aa8c656697ea2c625 to your computer and use it in GitHub Desktop.
import { IsString } from 'class-validator';
export class CreateCoffeeDto {
@IsString()
readonly name: string;
@IsString()
readonly brand: string;
@IsString({ each: true })
readonly flavors: string[];
}
import { PartialType } from '@nestjs/mapped-types';
import { CreateCoffeeDto } from './create-coffee.dto';
export class UpdateCoffeeDto extends PartialType(CreateCoffeeDto) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment