diff --git a/src/pages/emotion/message/EmotionMessage.tsx b/src/pages/emotion/message/EmotionMessage.tsx index e0df372..e5cff5b 100644 --- a/src/pages/emotion/message/EmotionMessage.tsx +++ b/src/pages/emotion/message/EmotionMessage.tsx @@ -192,20 +192,20 @@ const EmotionMessage = () => { **응답 형식**: { "prediction": { - "totalScore": "숫자", - "social": "숫자", - "sexual": "숫자", - "relational": "숫자", - "refusing": "숫자", - "essential": "숫자" + "totalScore": 숫자, + "social": 숫자, + "sexual": 숫자, + "relational": 숫자, + "refusing": 숫자, + "essential": 숫자 }, "emotions": { - "joy": "숫자", - "sadness": "숫자", - "anger": "숫자", - "fear": "숫자", - "surprise": "숫자", - "disgust": "숫자" + "joy": 숫자, + "sadness": 숫자, + "anger": 숫자, + "fear": 숫자, + "surprise": 숫자, + "disgust": 숫자 }, "missions": ["내용", "내용"], "keywords": "#내용 #내용 #내용" diff --git a/src/pages/emotion/result/EmotionResult.tsx b/src/pages/emotion/result/EmotionResult.tsx index 9cc3bf6..49a4941 100644 --- a/src/pages/emotion/result/EmotionResult.tsx +++ b/src/pages/emotion/result/EmotionResult.tsx @@ -8,10 +8,19 @@ import ECharts from 'echarts-for-react'; // import { useEffect, useState } from 'react'; import Button from '@components/common/Button'; import { useNavigate } from 'react-router-dom'; +import usePrevRecordStore from '@store/usePrevRecordStore'; +import useEmotionStore from '@store/useEmotionStore'; const EmotionResult = () => { - const analysisResult = useAnalysisStore((state) => state.analysis) || { keywords: [] }; + const analysisResult = useAnalysisStore((state) => state.analysis); + const prevRecord = usePrevRecordStore((state) => state.record); + const resetEmotion = useEmotionStore((state) => state.reset); + const resetAnalysisResult = useAnalysisStore((state) => state.reset); + const resetPrevRecord = useAnalysisStore((state) => state.reset); const navigate = useNavigate(); + + console.log(prevRecord); + console.log(analysisResult); // const [data, setData] = useState(null); // const result_pk = 1; @@ -31,6 +40,9 @@ const EmotionResult = () => { // if (!data) return
로딩중.. 데이터가 없음
; const handleClick = () => { + resetEmotion(); + resetAnalysisResult(); + resetPrevRecord(); navigate('/'); };