Skip to content

Instantly share code, notes, and snippets.

@gmwill934
Created January 14, 2021 21:03
Show Gist options
  • Save gmwill934/c3c68650f773018aa8c656697ea2c625 to your computer and use it in GitHub Desktop.
Save gmwill934/c3c68650f773018aa8c656697ea2c625 to your computer and use it in GitHub Desktop.

Revisions

  1. gmwill934 created this gist Jan 14, 2021.
    18 changes: 18 additions & 0 deletions mapped-types-error.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    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) {}