From 708696c4f141b6774a9224e6d5cd0210e577d467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=84=ED=9D=AC=EC=84=A0?= Date: Mon, 18 Nov 2024 17:50:12 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=85=20done:=20localstorage=20MemberId?= =?UTF-8?q?=20Post=20=EA=B5=AC=ED=98=84=20=EC=99=84=EB=A3=8C=20?= =?UTF-8?q?=F0=9F=92=84=20style:=20=EB=B2=84=ED=8A=BC=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EC=8B=9C=20=EC=84=A0=ED=83=9D=EB=90=9C=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EC=A1=B0=EA=B1=B4=EB=B6=80=20?= =?UTF-8?q?=EB=A0=8C=EB=8D=94=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/emotion/mission/EmotionMission.tsx | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/pages/emotion/mission/EmotionMission.tsx b/src/pages/emotion/mission/EmotionMission.tsx index 653eb29..16216f0 100644 --- a/src/pages/emotion/mission/EmotionMission.tsx +++ b/src/pages/emotion/mission/EmotionMission.tsx @@ -18,18 +18,18 @@ import useEmotionStore from '@store/useEmotionStore'; const EMOTIONS_RESULT_URL = '/emotions/results/'; const EmotionMission = () => { - const [clickButton, setClickButton] = useState('/src/assets/Images/invaildGray.svg'); + const [, setClickButton] = useState('/src/assets/Images/invaildGray.svg'); const [selectedMission, setSelectedMission] = useState(null); const navigate = useNavigate(); const analysisResult = useAnalysisStore((state) => state.analysis); - const message = useEmotionStore((state) => state.message); - console.log(message); + // console.log(message); - console.log(analysisResult); - console.log(message); + // console.log(analysisResult); + // console.log(message); + // console.log(localStorage.getItem('MemberId')); const handleHover = (mission: string) => { setClickButton('/src/assets/Images/valid.svg'); @@ -39,7 +39,7 @@ const EmotionMission = () => { const handleClick = async () => { const my_emotion = { - member_id: 34, + member_id: localStorage.getItem('MemberId'), mission_content: selectedMission, is_complement: false, interest_keyword: analysisResult.keywords, @@ -66,9 +66,9 @@ const EmotionMission = () => { body: JSON.stringify(my_emotion), }); console.log('Mission submitted:', selectedMission); - navigate('/emotion/result'); const data = await response.json(); console.log(data); + navigate('/emotion/result'); } catch (error) { console.error('전송 에러:', error); } @@ -99,7 +99,12 @@ const EmotionMission = () => { }} > {mission} - 선택 + 선택 ))} @@ -109,7 +114,9 @@ const EmotionMission = () => {
배우자가 나에게 작성한 한마디를 확인 할 수 있어요 -