diff --git a/components/AddComment.tsx b/components/AddComment.tsx index e3d6238b6..9f0659ccf 100644 --- a/components/AddComment.tsx +++ b/components/AddComment.tsx @@ -51,6 +51,10 @@ function AddComment({ id, setCommentList }: AddCommentProps) { setCommentList((prevCommentList) => [newComment, ...prevCommentList]); } catch (error) { console.error("댓글 등록 중 오류가 발생했습니다: ", error); + } finally { + setInputValue({ + content: "", + }); } } diff --git a/pages/board/[id].tsx b/pages/board/[id].tsx index 2fa4fe8b3..8491812a8 100644 --- a/pages/board/[id].tsx +++ b/pages/board/[id].tsx @@ -16,7 +16,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) { const LIMIT = 10; const commentResponse = await axios.get( - `/products/${id}/comments?limit=${LIMIT}`, + `/articles/${id}/comments?limit=${LIMIT}`, ); const commentList = commentResponse.data.list ?? [];