File tree Expand file tree Collapse file tree 2 files changed +22
-11
lines changed
components/modalDashboard Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,5 @@ export const getColumn = async ({
6161 dashboardId,
6262 } ,
6363 } ) ;
64- console . log ( "🟦 서버 응답:" , res . data ) ;
65- console . log ( "URL:" , apiRoutes . columns ( TEAM_ID ) ) ;
66- console . log ( "대시보드 ID:" , dashboardId ) ;
6764 return res . data . data ;
6865} ;
Original file line number Diff line number Diff line change 1- /* eslint-disable react-hooks/rules-of-hooks */
21import { useMemo , useRef , useState } from "react" ;
32import { MoreVertical , X } from "lucide-react" ;
43import CardDetail from "./CardDetail" ;
@@ -74,7 +73,28 @@ export default function CardDetailPage({
7473 } , 1500 ) ;
7574 } ,
7675 } ) ;
76+ const initialData = {
77+ title : card . title ,
78+ description : card . description ,
79+ dueDate : card . dueDate ,
80+ tags : card . tags ,
81+ assignee : card . assignee ,
82+ } ;
7783
84+ const handleClose = ( ) => {
85+ onClose ( ) ;
86+
87+ const hasChanged =
88+ cardData . title !== initialData . title ||
89+ cardData . description !== initialData . description ||
90+ ! isEqual ( cardData . dueDate , initialData . dueDate ) ||
91+ JSON . stringify ( cardData . tags ) !== JSON . stringify ( initialData . tags ) ||
92+ JSON . stringify ( cardData . assignee ) !==
93+ JSON . stringify ( initialData . assignee ) ;
94+ if ( hasChanged ) {
95+ router . reload ( ) ; // 수정된 게 있을 경우만 새로고침
96+ }
97+ } ;
7898 const handleCommentSubmit = ( ) => {
7999 if ( ! commentText . trim ( ) ) return ;
80100 createCommentMutate ( {
@@ -134,13 +154,7 @@ export default function CardDetailPage({
134154 ) }
135155 </ div >
136156
137- < button
138- onClick = { ( ) => {
139- onClose ( ) ;
140- router . reload ( ) ; // ✅ Next.js 방식 리로드
141- } }
142- title = "닫기"
143- >
157+ < button onClick = { handleClose } title = "닫기" >
144158 < X className = "w-7 h-7 flex items-center justify-center hover:cursor-pointer" />
145159 </ button >
146160 </ div >
You can’t perform that action at this time.
0 commit comments