Skip to content

Commit

Permalink
feat: add stickers to validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-Frost committed May 19, 2024
1 parent ad5d5d5 commit 8b3951c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/posts/dto/create-post.dto.ts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit 8b3951c

Please sign in to comment.