Skip to content

Commit

Permalink
fix: 게시글 상세 페이지의 댓글 api url을 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ojm51 committed Aug 16, 2024
1 parent 3bc1d3f commit 1d8d058
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions components/AddComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ function AddComment({ id, setCommentList }: AddCommentProps) {
setCommentList((prevCommentList) => [newComment, ...prevCommentList]);
} catch (error) {
console.error("댓글 등록 중 오류가 발생했습니다: ", error);
} finally {
setInputValue({
content: "",
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion pages/board/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?? [];

Expand Down

0 comments on commit 1d8d058

Please sign in to comment.