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;