diff --git a/src/article/dto/create-article.dto.ts b/src/article/dto/create-article.dto.ts index a52d01d3..ad6a4459 100644 --- a/src/article/dto/create-article.dto.ts +++ b/src/article/dto/create-article.dto.ts @@ -1,6 +1,11 @@ +import { IsNotEmpty } from 'class-validator'; export class CreateArticleDto { + @IsNotEmpty() readonly title: string; + @IsNotEmpty() readonly description: string; + @IsNotEmpty() readonly body: string; + @IsNotEmpty() readonly tagList: string[]; } diff --git a/src/article/dto/create-comment.ts b/src/article/dto/create-comment.ts index cd365c0f..e29b969f 100644 --- a/src/article/dto/create-comment.ts +++ b/src/article/dto/create-comment.ts @@ -1,3 +1,5 @@ +import { IsNotEmpty } from 'class-validator'; export class CreateCommentDto { + @IsNotEmpty() readonly body: string; }