Skip to content

Commit

Permalink
Merge pull request codestates-seb#366 from nalsae/develop
Browse files Browse the repository at this point in the history
[FE] ๐Ÿ› ํ”„๋ก ํŠธ ๋ฐฐํฌ ์ด์Šˆ ํ•ด๊ฒฐ
  • Loading branch information
nalsae authored Dec 26, 2023
2 parents 4c515fc + 52d8480 commit c4c214e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions client/src/components/garden/Comment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
};

Expand All @@ -65,7 +69,6 @@ export default function Comment({ comment, guestbookId }: CommentProps) {
/>
<DateAndControlSection
date={new Date(comment?.createdAt)}
isOwner={isOwner}
usage="comment"
ownerId={String(comment.guestbookId)}
targetId={String(comment.guestbookId)}
Expand Down

0 comments on commit c4c214e

Please sign in to comment.