From aac47a44f68dbb37cc1bf95a6c30124cace404a9 Mon Sep 17 00:00:00 2001 From: "dimpl@JinYoung" Date: Wed, 9 Dec 2020 22:16:04 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20REFACTOR:=20error=20message=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?=EB=90=9C=20=ED=95=A8=EC=88=98=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/models/dto/section.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/src/models/dto/section.js b/server/src/models/dto/section.js index 4fdc5866..a623b108 100644 --- a/server/src/models/dto/section.js +++ b/server/src/models/dto/section.js @@ -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()