From a56c699cecd6c72a71da4ec90bd2733068953fd2 Mon Sep 17 00:00:00 2001 From: chaem03 Date: Thu, 14 Nov 2024 21:28:54 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]-=20=EA=B8=B0=EC=A1=B4=20=EC=84=A0?= =?UTF-8?q?=ED=83=9D=20=EC=B9=A9=20=EB=93=A4=EA=B3=A0=20=EC=98=A4=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useForm.js | 1 - src/pages/nuguPatch/NuguPatch.jsx | 6 ++++++ src/pages/nuguPatch/_hooks/usePatchChip.js | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hooks/useForm.js b/src/hooks/useForm.js index 3c98674..0efe348 100644 --- a/src/hooks/useForm.js +++ b/src/hooks/useForm.js @@ -9,7 +9,6 @@ export const useForm = (atomState) => { ...prevForm, [name]: value, })); - console.log("입력된 정보:", { ...form, [name]: value }); }; const isValid = Object.values(form).every((value) => value.trim() !== ""); diff --git a/src/pages/nuguPatch/NuguPatch.jsx b/src/pages/nuguPatch/NuguPatch.jsx index 6d81ed7..50fea09 100644 --- a/src/pages/nuguPatch/NuguPatch.jsx +++ b/src/pages/nuguPatch/NuguPatch.jsx @@ -23,6 +23,12 @@ export const NuguPatch = () => { try { const userData = await getNugu(); setUpdateData(userData); + const initialSelectedChips = [ + userData.keyword1, + userData.keyword2, + userData.keyword3, + ]; + handleClickStatus(initialSelectedChips); } catch (err) { console.error("Patch-user정보 가져오기 실패", err); } diff --git a/src/pages/nuguPatch/_hooks/usePatchChip.js b/src/pages/nuguPatch/_hooks/usePatchChip.js index 8871acc..ef3712d 100644 --- a/src/pages/nuguPatch/_hooks/usePatchChip.js +++ b/src/pages/nuguPatch/_hooks/usePatchChip.js @@ -16,6 +16,7 @@ export const usePatchChip = () => { const handleClickStatus = (index) => { const updatedChip = [...selectedChip]; + console.log(updatedChip); updatedChip[index] = !updatedChip[index]; if (updatedChip.filter((chip) => chip).length > 3) { return;