From bbbf8404d99cc35595ef7228dca21e177d40dacf Mon Sep 17 00:00:00 2001 From: MyungJiwoo <1206jiwoo@gmail.com> Date: Mon, 23 Sep 2024 15:45:32 +0900 Subject: [PATCH] =?UTF-8?q?#65=20fix:=20=EC=B1=8C=EB=A6=B0=EC=A7=80=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EC=95=88=EB=90=98=EB=8A=94=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95=20(=EC=9E=98=EB=AA=BB=EB=90=9C?= =?UTF-8?q?=20=EB=B9=88=20=ED=8F=BC=20=EA=B2=80=EC=82=AC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/CreateChallengePage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/CreateChallengePage.tsx b/src/pages/CreateChallengePage.tsx index b9e17d0..60275f4 100644 --- a/src/pages/CreateChallengePage.tsx +++ b/src/pages/CreateChallengePage.tsx @@ -179,14 +179,16 @@ const CreateChallengePage = () => { // * 제출시 빈 칸이 있나 확인하는 함수 (있다면 true, 대표 이미지는 선택이라 제외) const validateFormData = (formData: Challenge): boolean => { return Object.entries(formData).some(([key, value]) => { - // representImage 필드는 검사에서 제외 - if (key === 'representImage') return false; + // representImage, authorName, authorProfileImage 필드는 검사에서 제외 + if (key === 'representImage' || key === 'authorName' || key === 'authorProfileImage') + return false; return value === ''; }); }; // * 폼 제출 핸들러 const handleSubmit = async () => { + console.log(formData); // 빈 작성란이 있으면 모달창 띄우기 if (validateFormData(formData)) { openModal('normal'); // 모달 띄우기 (yes/no 모달)