[홍명주] Sprint8#126
Merged
gyulrangdev merged 25 commits intocodeit-sprint-fullstack:next-홍명주from Sep 30, 2025
Hidden character warning
The head ref may contain hidden characters: "next-\ud64d\uba85\uc8fc"
Merged
Conversation
- Delete Board component - Use BoardBest for server component - Use BoardList for client component
gyulrangdev
reviewed
Sep 30, 2025
Collaborator
gyulrangdev
left a comment
There was a problem hiding this comment.
대부분의 기능을 잘 구현해주셨고 특히 서버 컴포넌트, 클라이언트 컴포넌트를 나누어 사용하신 코드가 인상적이었습니다.
고생하셨습니다~
| sort === "latest" ? "_sort=-createdAt" : "_sort=-likes"; | ||
|
|
||
| try { | ||
| const res = await fetch(`http://localhost:4000/posts?${sortParams}`); |
Collaborator
There was a problem hiding this comment.
fetch의 모든 곳에서 http://localhost:4000 가 하드코딩 되어있습니다. 환경변수로 관리해보시면 어떨까요?
|
|
||
| const BoardDetailPage = async ({ params }) => { | ||
| const { id } = await params; | ||
| const res = await fetch(`http://localhost:4000/posts/${id}`); |
Collaborator
There was a problem hiding this comment.
fetch가 실패할 케이스의 에러 처리가 필요해보여요
|
|
||
| if (!res.ok) { | ||
| alert("게시글 삭제에 실패했습니다."); | ||
| console.error(res.statusText); |
Collaborator
There was a problem hiding this comment.
에러 이후에도 성공 로직이 실행하게 되어있어요. return; 추가가 필요해보입니다.
| const res = await fetch(`http://localhost:4000/posts?${sortParams}`); | ||
|
|
||
| if (!res.ok) { | ||
| throw new Error("response error: ", res.statusText); |
Collaborator
There was a problem hiding this comment.
javascript의 Error 객체 생성자를 참고해보세요. https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Error/Error#%EC%98%88%EC%A0%9C
만일 message의 용도로 사용하셨다면 하나의 string으로 만드셔야 할 것 같아요.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본 요구사항
공통
자유 게시판 페이지
게시글 등록 & 수정 페이지
게시글 상세 페이지
심화 요구사항
공통
주요 변경사항
스크린샷
멘토에게