From 52d84809872cf554797da9e96a9aaf785f7bc858 Mon Sep 17 00:00:00 2001 From: nalsae Date: Tue, 26 Dec 2023 19:23:44 +0900 Subject: [PATCH] =?UTF-8?q?[FE]=20=F0=9F=90=9B=20Fix=20:=20=EB=B0=B0?= =?UTF-8?q?=ED=8F=AC=20=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/garden/Comment.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/client/src/components/garden/Comment.tsx b/client/src/components/garden/Comment.tsx index c97b5ff3..ac9f05c4 100644 --- a/client/src/components/garden/Comment.tsx +++ b/client/src/components/garden/Comment.tsx @@ -29,10 +29,10 @@ export default function Comment({ comment, guestbookId }: CommentProps) { const { editMode, targetId, setEditMode } = usePostStore(); const { userId } = useUserStore(); - const { mutate: editComment } = useEditCommentMutation({ - guestbookId, - targetId, - }); + // const { mutate: editComment } = useEditCommentMutation({ + // guestbookId, + // targetId, + // }); const { register, @@ -44,12 +44,16 @@ export default function Comment({ comment, guestbookId }: CommentProps) { }, }); - const isEdit = editMode && String(comment.commentId) === targetId; + const isEdit = editMode && String(comment.guestbookId) === targetId; + + // const isOwner = userId === String(comment.accountId); - const isOwner = userId === String(comment.accountId); + // const submitCommentForm = (data: CommentInputValue) => { + // editComment(data); + // setEditMode(false); + // }; const submitCommentForm = (data: CommentInputValue) => { - editComment(data); setEditMode(false); }; @@ -65,7 +69,6 @@ export default function Comment({ comment, guestbookId }: CommentProps) { />