Conversation
|
MATEBALL-STORYBOOK |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Walkthrough마이페이지 화면의 디자인을 개선하기 위해 배경색, 텍스트 색상, 구분선 스타일을 조정했습니다. 동시에 사용자 쿼리의 응답 처리 로직을 개선하고, 헤더와 하단 네비게이션의 프로필 경로에 대한 스타일링을 추가했습니다. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/shared/apis/user/user-queries.ts (1)
20-40: 방어적 응답 처리 패턴이 적절합니다.API 응답이 이중으로 래핑될 수 있는 상황을 처리하는 로직이 잘 구현되어 있습니다.
getUserInfoResponse타입에는status,message,data속성이 없으므로 shape 체크 방식이 유효합니다.다만, 동일한 패턴이
MATCH_CONDITION에도 중복되어 있으니 헬퍼 함수로 추출하는 것을 고려해 보세요.♻️ 헬퍼 함수 추출 제안
function unwrapResponse<T>(res: T | ApiResponse<T>, errorMessage: string): T { if ( typeof res === 'object' && res !== null && 'status' in res && 'message' in res && 'data' in res ) { if (!res.data) { throw new Error(errorMessage); } return res.data; } return res as T; }사용 예시:
USER_INFO: () => queryOptions<getUserInfoResponse>({ queryKey: USER_KEY.INFO(), queryFn: async () => { const res = await get<getUserInfoResponse | ApiResponse<getUserInfoResponse>>( END_POINT.GET_USER_INFO, ); - - if ( - typeof res === 'object' && - res !== null && - 'status' in res && - 'message' in res && - 'data' in res - ) { - if (!res.data) { - throw new Error('유저 정보 응답 데이터가 없습니다.'); - } - - return res.data; - } - - return res as getUserInfoResponse; + return unwrapResponse(res, '유저 정보 응답 데이터가 없습니다.'); }, }),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/shared/apis/user/user-queries.ts` around lines 20 - 40, Extract the duplicate response-unwrapping logic into a generic helper like unwrapResponse<T>(res, errorMessage) and use it from the queryFn in getUserInfo and from MATCH_CONDITION handling; specifically remove the inline shape-check in the anonymous queryFn and in MATCH_CONDITION and call unwrapResponse<getUserInfoResponse>(res, '유저 정보 응답 데이터가 없습니다.') (or appropriate error messages) so both places reuse the same function, keeping the helper signature and behaviour exactly matching the provided pattern (check object/null and 'status'|'message'|'data', throw when data is falsy, otherwise return data).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/shared/apis/user/user-queries.ts`:
- Around line 20-40: Extract the duplicate response-unwrapping logic into a
generic helper like unwrapResponse<T>(res, errorMessage) and use it from the
queryFn in getUserInfo and from MATCH_CONDITION handling; specifically remove
the inline shape-check in the anonymous queryFn and in MATCH_CONDITION and call
unwrapResponse<getUserInfoResponse>(res, '유저 정보 응답 데이터가 없습니다.') (or appropriate
error messages) so both places reuse the same function, keeping the helper
signature and behaviour exactly matching the provided pattern (check object/null
and 'status'|'message'|'data', throw when data is falsy, otherwise return data).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 831b4f0a-95b8-4919-885d-1fd9e9983262
📒 Files selected for processing (6)
src/pages/profile/profile.tsxsrc/shared/apis/user/user-queries.tssrc/shared/components/bottom-navigation/bottom-navigation.tsxsrc/shared/components/footer/footer.tsxsrc/shared/components/header/header.tsxsrc/shared/components/header/utils/get-header.tsx
* fix: 쿼리 수정 (#419) * fix: 바텀시트 수정 (#419) * fix: 메이트 프로필 카드 수정 (#419) * fix: cta bottom sheet 연결 (#419) * style: 자잘한 수정 (#419) * feat: 가이드 메시지 추가 (#419) * fix: 가이드 메시지 수정 (#419) * fix: 그룹 매칭 생성 페이지 수정 (#419) * fix: 매칭된 그룹원 리스트 상세 조회 쿼리 수정 (#419) * feat: 전체 유저수 api 연결 (#419) * fix: 1:1 매칭 생성 완료 페이지 로직 및 뷰 수정 (#419) * chore: 네이밍 변경 (#419) * feat: cta 바텀시트 연결 (#419) * feat: 경기 매칭 페이지 cta 바텀 시트 연결 (#419) * feat: 내가 만든 매칭일 경우 토스트 에러메시지 추가 (#419) * fix: 리뷰 반영 (#419) * chore: 충돌 해결 (#419) * fix: SP2 마이페이지 화면 수정 (#422) * style: fotter color 수정 (#421) * style: bottom navigation color 수정 (#421) * style: 마이페이지 text color 수정 (#421) * fix: 마이페이지 헤더 수정 (#421) * fix: user query 수정 (#421) * chore: build 에러 해결 (#419)
#️⃣ Related Issue
Closes #421
💎 PR Point
📸 Screenshot
Summary by CodeRabbit
릴리스 노트
스타일
버그 수정