Conversation
GitJIHO
left a comment
There was a problem hiding this comment.
상세 페이지 작업 감사합니다 :)
https 변환 부분과 프록시 부분만 확인했습니다 👍
| server: { | ||
| proxy: { | ||
| '/api/v1': { | ||
| target: 'https://algo.knu-soft.site', | ||
| changeOrigin: true, | ||
| secure: false, | ||
| }, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
프록시 설정 👍
secure 설정같은 경우 개발 환경에서는 false로 해도 괜찮은데 배포 환경에서는 true로 하는게 보안상 괜찮을 것 같아요.
해당 secure은 프론트 로컬환경의 ssl인증서 검사가 아닌, 프록시 타겟에 해당하는 도메인의 ssl 인증서 검사라 true로 적용해도 작동할 겁니당
속도같은 경우 찾아보니 true의 경우 핸드세이크 과정이 추가되어 속도가 false에 비해 느려지지만, 실제로는 밀리초 단위라고 합니다..!
Dobbymin
left a comment
There was a problem hiding this comment.
ESLint에 발생하는 오류부터 해결해야할 것 같습니다...!
| 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]); |
There was a problem hiding this comment.
useQuery를 사용하지 않고 직접 api 호출을 한 이유가 따로 있나요?? loading 상태를 이용하는거라면 useQuery를 이용하는게 더 효율적일것 같아요.
| if (loading) { | ||
| return ( | ||
| <Flex justify='center' align='center' w='full' h='200px'> | ||
| Loading... | ||
| </Flex> | ||
| ); | ||
| } |
There was a problem hiding this comment.
로딩상태는 Spinner 혹은 Skeleton UI를 활용해주세요.
| // 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`; |
There was a problem hiding this comment.
BASE_URI 라는 상수는 어떤걸 의미하고 있을까요?
과연 SERVER_FILE_URI 라는 상수를 다시 생성해서 api 호출에 사용하는게 옳은 방법일까요?
상수화를 진행하여 재사용하는 이유에 대해 조금 더 고민해보면 좋을것 같아요.
📝 상세 내용
우선적으로 게시글 제목, 작성자, 날짜, 태그, 내용 불러오는 기능만 구현함.
현재 미구현 된 내용 =>
#️⃣ 이슈 번호
💬 리뷰 요구사항
아직 머지 하면 안됩니다 ㅠ
⏰ 현재 버그
📷 스크린샷(선택)
🔗 참고 자료(선택)