Skip to content

issue#45 게시글 상세페이지 기능 구현#82

Closed
gogumalatte wants to merge 11 commits intodevelopfrom
Feat/issue-#45
Closed

issue#45 게시글 상세페이지 기능 구현#82
gogumalatte wants to merge 11 commits intodevelopfrom
Feat/issue-#45

Conversation

@gogumalatte
Copy link
Contributor

📝 상세 내용

우선적으로 게시글 제목, 작성자, 날짜, 태그, 내용 불러오는 기능만 구현함.
현재 미구현 된 내용 =>

  1. 인가되지 않은 사용자도 기능을 이용할 수 있어서 제한해야 함. (작성자가 아닌 사용자는 수정, 삭제 못하도록, 로그인 하지 않은 사용자는 좋아요, 댓글 작성 못하도록)
  2. 댓글 기능

#️⃣ 이슈 번호

💬 리뷰 요구사항

아직 머지 하면 안됩니다 ㅠ

⏰ 현재 버그

📷 스크린샷(선택)

🔗 참고 자료(선택)

@gogumalatte gogumalatte self-assigned this Feb 18, 2025
@gogumalatte gogumalatte linked an issue Feb 18, 2025 that may be closed by this pull request
2 tasks
Copy link
Member

@GitJIHO GitJIHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

상세 페이지 작업 감사합니다 :)
https 변환 부분과 프록시 부분만 확인했습니다 👍

Comment on lines +23 to +31
server: {
proxy: {
'/api/v1': {
target: 'https://algo.knu-soft.site',
changeOrigin: true,
secure: false,
},
},
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

프록시 설정 👍
secure 설정같은 경우 개발 환경에서는 false로 해도 괜찮은데 배포 환경에서는 true로 하는게 보안상 괜찮을 것 같아요.
해당 secure은 프론트 로컬환경의 ssl인증서 검사가 아닌, 프록시 타겟에 해당하는 도메인의 ssl 인증서 검사라 true로 적용해도 작동할 겁니당
속도같은 경우 찾아보니 true의 경우 핸드세이크 과정이 추가되어 속도가 false에 비해 느려지지만, 실제로는 밀리초 단위라고 합니다..!

Copy link
Member

@Dobbymin Dobbymin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint에 발생하는 오류부터 해결해야할 것 같습니다...!

Comment on lines +18 to +42
const { postId } = useParams();
const [post, setPost] = useState<ResponsePostDetail | null>(null);
const [tags, setTags] = useState<ResponsePostTags | null>(null);
const [loading, setLoading] = useState(true);

useEffect(() => {
if (!postId) return;

const fetchPostData = async () => {
try {
setLoading(true);
const postDetail = await getPostDetail({ postId: Number(postId) });
const postTags = await getPostTags({ postId: Number(postId) });

setPost(postDetail);
setTags(postTags);
} catch (error) {
console.error('게시글 정보를 불러오는 데 실패했습니다.', error);
} finally {
setLoading(false);
}
};

fetchPostData();
}, [postId]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useQuery를 사용하지 않고 직접 api 호출을 한 이유가 따로 있나요?? loading 상태를 이용하는거라면 useQuery를 이용하는게 더 효율적일것 같아요.

Comment on lines +44 to +50
if (loading) {
return (
<Flex justify='center' align='center' w='full' h='200px'>
Loading...
</Flex>
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로딩상태는 Spinner 혹은 Skeleton UI를 활용해주세요.

Comment on lines +6 to +9
// export const BASE_URI = `https://algo.knu-soft.site${API_PREFIX}`;
export const BASE_URI = `${API_PREFIX}`;

export const SERVER_FILE_URI = `http://algo.knu-soft.site`;
export const SERVER_FILE_URI = `https://algo.knu-soft.site`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BASE_URI 라는 상수는 어떤걸 의미하고 있을까요?
과연 SERVER_FILE_URI 라는 상수를 다시 생성해서 api 호출에 사용하는게 옳은 방법일까요?

상수화를 진행하여 재사용하는 이유에 대해 조금 더 고민해보면 좋을것 같아요.

@gogumalatte gogumalatte changed the title issue#43 게시글 상세페이지 기능 구현 issue#45 게시글 상세페이지 기능 구현 Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[기능 구현] 게시글 상세보기 페이지 기능 구현

3 participants