@@ -20,18 +20,19 @@ const RandomLettersPage = () => {
2020 category : 'ETC' ,
2121 title : 'error' ,
2222 zipCode : 'error' ,
23- paperType : 'BASIC' ,
24- fontType : 'DEFAULT' ,
23+ writerId : 0 ,
2524 createdAt : new Date ( ) ,
2625 } ) ;
2726 const [ matchedLetter , setMatchedLetter ] = useState < MatchedLetter > ( {
2827 letterId : 0 ,
2928 category : 'ETC' ,
3029 title : 'error' ,
30+ content : 'error' ,
3131 zipCode : 'error' ,
3232 paperType : 'BASIC' ,
3333 fontType : 'DEFAULT' ,
3434 createdAt : new Date ( ) ,
35+ writerId : 0 ,
3536 replyDeadLine : new Date ( ) ,
3637 temporary : false ,
3738 } ) ;
@@ -43,30 +44,10 @@ const RandomLettersPage = () => {
4344 const res = await getRandomLetterMatched ( ) ;
4445 if ( res ?. status === 200 ) {
4546 const data : MatchedLetter = res . data . data ;
47+ console . log ( data ) ;
4648 if ( data ?. temporary === true ) {
4749 setIsMatched ( true ) ;
48- setMatchedLetter ( {
49- letterId : data . letterId ,
50- category : data . category ,
51- title : data . title ,
52- zipCode : data . zipCode ,
53- paperType : data . paperType ,
54- fontType : data . fontType ,
55- createdAt : data . createdAt ,
56- replyDeadLine : data . replyDeadLine ,
57- temporary : data . temporary ,
58- } ) ;
59- console . log ( {
60- letterId : data . letterId ,
61- category : data . category ,
62- title : data . title ,
63- zipCode : data . zipCode ,
64- paperType : data . paperType ,
65- fontType : data . fontType ,
66- createdAt : data . createdAt ,
67- replyDeadLine : data . replyDeadLine ,
68- temporary : data . temporary ,
69- } ) ;
50+ setMatchedLetter ( data ) ;
7051 }
7152 }
7253 } ;
@@ -94,7 +75,7 @@ const RandomLettersPage = () => {
9475 return (
9576 < >
9677 { openSelectedDetailModal ? (
97- < MatchedLetter selectedLetter = { selectedLetter } />
78+ < MatchedLetter matchedLetter = { matchedLetter } />
9879 ) : (
9980 < >
10081 < div className = "z-10 flex grow flex-col items-center overflow-hidden" >
@@ -115,9 +96,10 @@ const RandomLettersPage = () => {
11596 ) : (
11697 < Matched
11798 // MEMO : 여기 selectedLetter가 아니라 MatchedLetter 들어가야함
118- selectedLetter = { selectedLetter }
99+ matchedLetter = { matchedLetter }
119100 setIsMatched = { setIsMatched }
120101 setIsCoolTime = { setIsCoolTime }
102+ setOpenSelectedDetailModal = { setOpenSelectedDetailModal }
121103 />
122104 ) }
123105
@@ -126,6 +108,7 @@ const RandomLettersPage = () => {
126108 setOpenModal = { setOpenSelectModal }
127109 selectedLetter = { selectedLetter }
128110 setOpenSelectedDetailModal = { setOpenSelectedDetailModal }
111+ setMatchedLetter = { setMatchedLetter }
129112 />
130113 ) }
131114 </ div >
0 commit comments