diff --git a/src/posts/dto/create-post.dto.ts b/src/posts/dto/create-post.dto.ts index 5b6b975..3f995c9 100644 --- a/src/posts/dto/create-post.dto.ts +++ b/src/posts/dto/create-post.dto.ts @@ -1,16 +1,19 @@ import { Transform, Type } from 'class-transformer'; import { IsDecimal, + IsIn, IsInt, IsNotEmpty, IsOptional, IsString, ValidateNested, } from 'class-validator'; +import { stickers } from '../constants'; class StickerDto { @IsString() @IsNotEmpty() + @IsIn(stickers.map((sticker) => sticker.name)) name: string; @IsDecimal()