Skip to content

Commit

Permalink
[BE] REFACTOR: error message 경로 수정 및 변경된 함수 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
pjy0416 committed Dec 9, 2020
1 parent 69d6619 commit aac47a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions server/src/models/dto/section.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
const { IsUUID, IsString, IsInt, MinLength } = require('class-validator');
const errorMessage = require('@models/dto/error-messages');
const errorMessage = require('@utils/error-messages');

class SectionDto {
@IsUUID('4')
id;

@IsString({ groups: ['create', 'update'] }, { message: errorMessage.wrongProperty('title') })
@MinLength(1, { groups: ['create', 'update'] }, { message: errorMessage.wrongProperty('title') })
@IsString({ groups: ['create', 'update'] }, { message: errorMessage.TYPE_ERROR('title') })
@MinLength(
1,
{ groups: ['create', 'update'] },
{ message: errorMessage.INVALID_INPUT_ERROR('title') },
)
title;

@IsInt()
Expand Down

0 comments on commit aac47a4

Please sign in to comment.