@@ -8,23 +8,30 @@ import { useCreateCategory } from "@/state/mutation/category";
88import { useCompleteCreateStar } from "@/state/mutation/star" ;
99import { useGetKeywords } from "@/state/query/keyword" ;
1010import { CategoryListProps } from "@/types/category" ;
11- import { BookmarkProps } from "@repo /types" ;
11+ import { CompleteSummarizeStarProps } from "@/types/star " ;
1212import { Keyword , RectangleButton , Textarea } from "@repo/ui" ;
1313
1414import { Navigate , useLocation } from "react-router-dom" ;
1515
1616const DEFAULT_BOOKMARK = {
1717 categoryName : "" ,
1818 categories : [ ] ,
19- summary : "" ,
20- memo : "" ,
19+ summaryAI : "" ,
20+ userMemo : "" ,
2121 keyword : "" ,
2222} ;
2323
24+ interface StateProps extends CompleteSummarizeStarProps {
25+ categoryName : string ;
26+ categories : CategoryListProps [ ] ;
27+ keyword : string ;
28+ keywords : string [ ] ;
29+ }
30+
2431const CreateBookmark = ( ) => {
2532 const { state } = useLocation ( ) ;
2633
27- const [ bookmark , setBookmark ] = useState < BookmarkProps > ( Object . assign ( DEFAULT_BOOKMARK , state ) ) ;
34+ const [ bookmark , setBookmark ] = useState < StateProps > ( Object . assign ( DEFAULT_BOOKMARK , state ) ) ;
2835
2936 const { mutateAsync } = useCompleteCreateStar ( ) ;
3037 const { mutateAsync : mutateAsyncCategory , isPending } = useCreateCategory ( ) ;
@@ -86,19 +93,13 @@ const CreateBookmark = () => {
8693 if ( ! categoryName ) {
8794 return ;
8895 }
96+
8997 const body = {
90- thumbnailUrl : state . thumbnailUrl ,
91- summaryAI : bookmark . summary ,
92- userMemo : bookmark . memo ,
93- categoryName,
98+ ...bookmark ,
9499 keywordList : bookmark . keywords ,
95- faviconUrl : state . faviconUrl ,
96100 } ;
97101
98- await mutateAsync ( {
99- starId : state . starId ,
100- body,
101- } ) ;
102+ await mutateAsync ( body ) ;
102103 } ;
103104
104105 return (
@@ -126,16 +127,16 @@ const CreateBookmark = () => {
126127 />
127128 < section >
128129 < Textarea
129- id = "summary "
130+ id = "summaryAI "
130131 label = "요약"
131- value = { bookmark . summary }
132+ value = { bookmark . summaryAI }
132133 onChange = { onChangeText }
133134 placeholder = "북마크에 대한 요약을 작성할 수 있어요."
134135 />
135136 < Textarea
136- id = "memo "
137+ id = "userMemo "
137138 label = "메모"
138- value = { bookmark . memo }
139+ value = { bookmark . userMemo }
139140 onChange = { onChangeText }
140141 placeholder = "북마크에 대한 메모를 작성할 수 있어요."
141142 />
0 commit comments