diff --git a/client/src/constants/errorMessage.ts b/client/src/constants/errorMessage.ts index e37220f7f..9758f3524 100644 --- a/client/src/constants/errorMessage.ts +++ b/client/src/constants/errorMessage.ts @@ -3,6 +3,7 @@ const ERROR_MESSAGE = { memberName: '참여자 이름은 8자 이하의 한글, 영어만 가능해요', purchasePrice: '10,000,000원 이하의 숫자만 입력이 가능해요', purchaseTitle: '지출 이름은 30자 이하의 한글, 영어, 숫자만 가능해요', + preventEmpty: '값은 비어있을 수 없어요', }; export default ERROR_MESSAGE; diff --git a/client/src/hooks/usePutAndDeleteBillAction/usePutAndDeleteBillAction.ts b/client/src/hooks/usePutAndDeleteBillAction/usePutAndDeleteBillAction.ts index 3e35dab76..50052e08d 100644 --- a/client/src/hooks/usePutAndDeleteBillAction/usePutAndDeleteBillAction.ts +++ b/client/src/hooks/usePutAndDeleteBillAction/usePutAndDeleteBillAction.ts @@ -9,6 +9,8 @@ import {useStepList} from '@hooks/useStepList/useStepList'; import {BillInputType, InputPair} from '@hooks/useDynamicBillActionInput'; +import ERROR_MESSAGE from '@constants/errorMessage'; + const usePutAndDeleteBillAction = ( initialValue: InputPair, validateFunc: (inputPair: Bill) => ValidateResult, @@ -66,7 +68,7 @@ const usePutAndDeleteBillAction = ( // blur시 값이 비었을 때 error state 반영 if (inputPair.price.length === 0 || inputPair.title.length === 0) { - setErrorMessage('값은 비어있을 수 없어요'); + setErrorMessage(ERROR_MESSAGE.preventEmpty); setErrorInfo({title: inputPair.title.length === 0, price: inputPair.price.length === 0}); setCanSubmit(false); return;