Skip to content

Commit 8b3951c

Browse files
feat: add stickers to validation
1 parent ad5d5d5 commit 8b3951c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/posts/dto/create-post.dto.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import { Transform, Type } from 'class-transformer';
22
import {
33
IsDecimal,
4+
IsIn,
45
IsInt,
56
IsNotEmpty,
67
IsOptional,
78
IsString,
89
ValidateNested,
910
} from 'class-validator';
11+
import { stickers } from '../constants';
1012

1113
class StickerDto {
1214
@IsString()
1315
@IsNotEmpty()
16+
@IsIn(stickers.map((sticker) => sticker.name))
1417
name: string;
1518

1619
@IsDecimal()

0 commit comments

Comments
 (0)