feat: 6주차 첫번째 미션#58
Open
kimdoyeon1234 wants to merge 12 commits into
Open
Conversation
yewon20804
reviewed
May 12, 2026
Collaborator
yewon20804
left a comment
There was a problem hiding this comment.
6주차 첫번째 미션 확인했습니다 ! useQuery를 사용해서 lp 목록 / 상세 페이지를 진행해주시는게 미션이였는데요🙂 PR 업로드 해주실 때 화면 녹화도 같이 포함해주면 코드 리뷰할 때 더 도움이 될 것 같습니다 ㅎㅎ 아래 코멘트도 확인해주세요 !
1. LpListPage.tsx — data?.data.map() 이중 접근
queryFn에서 이미 res.data.data를 반환하고 있는데, 렌더링 시 data?.data.map()으로 한 번 더 .data를 접근하고 있습니다. 정상적으로 LP 카드가 출력되고 있는지 확인이 필요할 것 같습니다 !
// 현재 (week6/client/src/pages/LpListPage.tsx)
queryFn: async () => {
const res = await api.get('/lps', { ... });
return res.data.data;
},
// 렌더링 시
data?.data.map((lp: any) => <LpCard ... />)
// 수정
data?.map((lp: any) => <LpCard key={lp.id} lp={lp} />)
2. MyPage.tsx — 로그아웃 시 refreshToken 미삭제
Layout.tsx의 로그아웃은 localStorage.clear()를 사용하는데, MyPage.tsx의 로그아웃 핸들러는 accessToken만 제거하고 있습니다 ! refreshToken이 남아있으면 토큰 갱신을 계속 시도할 수 있습니다.
// 현재 (week6/client/src/pages/MyPage.tsx)
const handleLogout = () => {
localStorage.removeItem('accessToken'); // refreshToken 잔존!
...
};
// 수정
const handleLogout = () => {
localStorage.clear(); // 또는 removeItem('accessToken') + removeItem('refreshToken') + removeItem('nickname')
...
};
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.
📌 작업 내용
어떤 작업을 했는지 한 줄 요약
✨ 상세 작업 내용
📸 스크린샷
✅ 체크리스트