From 45889da901c02e4acfc8e7978e2c0ae96dfdbad3 Mon Sep 17 00:00:00 2001 From: Ballbot <5252bb@daum.net> Date: Mon, 3 Jun 2024 20:25:20 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=B0=ED=83=80=EB=B0=A9=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ApartmentForm.component.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ApartmentForm.component.jsx b/src/components/ApartmentForm.component.jsx index 6b77ebb..f4b48ca 100644 --- a/src/components/ApartmentForm.component.jsx +++ b/src/components/ApartmentForm.component.jsx @@ -12,6 +12,7 @@ export default function ApartmentForm() { password: "", }) const [selectedApartment, setSelectedApartment] = useState() + const [submitClicked, setSubmitClicked] = useState(false) const onApartmentNameChanged = async (e) => { setSelectedApartment(null) @@ -31,13 +32,16 @@ export default function ApartmentForm() { } const onSubmit = async () => { + setSubmitClicked(true) if (createApartmentForm.nickname == "" || createApartmentForm.password == "") { alert("닉네임 또는 비밀번호가 비어있습니다."); + setSubmitClicked(false) return; } if (!selectedApartment) { alert("아파트를 리스트에서 선택해주세요!"); + setSubmitClicked(false) return; } @@ -55,6 +59,7 @@ export default function ApartmentForm() { alert("등록에 실패했습니다. :(") } } + setSubmitClicked(false) } return ( @@ -85,7 +90,7 @@ export default function ApartmentForm() { ...createApartmentForm, password: e.target.value })}/>
- + ); } \ No newline at end of file