Repository navigation
Conversation
플랫 endpoints.ts와 endpoints/ 폴더의 이중 정의로 인한 drift 위험 제거. - 플랫 src/lib/api/endpoints.ts 삭제 (파일/폴더 이름 충돌로 barrel을 가리던 문제 해소) - API_BASE_URL을 endpoints/base.ts 단일 정의로 통일 (운영 URL 하드코딩 fallback 제거 → Clubs/Image/Clubnotification/ClubsBookshelf를 ./base로 이전) - member 도메인 엔드포인트(check-nickname/additional-info/members/me/login-status)를 endpoints/member.ts로 일원화하고, auth.ts는 auth/* 만 보유 - authService가 member 도메인 호출은 MEMBER_ENDPOINTS를 사용하도록 변경 - URL 값은 모두 동일하여 동작 변화 없음 (tsc/lint 통과) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
refactor(api): API 엔드포인트 정의 단일 출처화 (#424)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe PR adds a shared unsaved-changes guard, wires it into multiple create/edit and navigation flows, and separates auth/member API endpoints into dedicated modules with updated service calls. ChangesUnsaved changes guard rollout
API endpoint split
Sequence Diagram(s)sequenceDiagram
participant Header
participant UnsavedChangesProvider
participant UnsavedChangesConfirmModal
participant router
Header->>UnsavedChangesProvider: confirmNavigation(() => router.push(href))
UnsavedChangesProvider->>UnsavedChangesConfirmModal: open prompt
UnsavedChangesConfirmModal->>UnsavedChangesProvider: Leave or Stay
UnsavedChangesProvider->>router: execute navigation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ 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.
Code Review
This pull request refactors API endpoints by moving member-related endpoints (such as ADDITIONAL_INFO, CHECK_NICKNAME, and PROFILE) from AUTH_ENDPOINTS to MEMBER_ENDPOINTS, updating their imports and usages across services. The review feedback suggests simplifying imports in authService.ts by utilizing the existing barrel export, and consolidating duplicate profile and login status retrieval methods between authService and memberService to eliminate redundant code and ensure consistent error handling.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| import { AUTH_ENDPOINTS } from "@/lib/api/endpoints/auth"; | ||
| import { MEMBER_ENDPOINTS } from "@/lib/api/endpoints/member"; |
There was a problem hiding this comment.
기존에 src/lib/api/endpoints/index.ts 파일에서 모든 엔드포인트를 export하는 배럴(barrel) 구조가 이미 정의되어 있습니다. 따라서 개별 파일에서 직접 가져오는 대신, @/lib/api/endpoints 경로를 통해 한 번에 가져오도록 코드를 단순화할 수 있습니다.
| import { AUTH_ENDPOINTS } from "@/lib/api/endpoints/auth"; | |
| import { MEMBER_ENDPOINTS } from "@/lib/api/endpoints/member"; | |
| import { AUTH_ENDPOINTS, MEMBER_ENDPOINTS } from "@/lib/api/endpoints"; |
| getProfile: async (): Promise<ApiResponse<User>> => { | ||
| return await apiClient.get<ApiResponse<User>>(AUTH_ENDPOINTS.PROFILE, { | ||
| return await apiClient.get<ApiResponse<User>>(MEMBER_ENDPOINTS.GET_PROFILE, { | ||
| silentAuthError: true, |
There was a problem hiding this comment.
현재 authService.getProfile과 memberService.getProfile 모두 동일한 엔드포인트(/members/me)를 호출하고 있어 기능이 중복됩니다.\n\n또한 authService에서는 silentAuthError: true 옵션을 사용하고 있으나 memberService에서는 누락되어 있어, 인증 에러 발생 시 일관되지 않은 사용자 경험(예: 불필요한 에러 토스트 노출 등)을 초래할 수 있습니다. 동일한 엔드포인트를 호출하는 서비스 메서드는 하나로 통합하고, 필요한 옵션은 매개변수로 전달받아 처리하도록 개선하는 것을 권장합니다.
| getLoginStatus: async (): Promise<ApiResponse<LoginStatusResponse>> => { | ||
| return await apiClient.get<ApiResponse<LoginStatusResponse>>( | ||
| AUTH_ENDPOINTS.LOGIN_STATUS, | ||
| MEMBER_ENDPOINTS.GET_LOGIN_STATUS, | ||
| { silentAuthError: true } | ||
| ); |
There was a problem hiding this comment.
Refactor 422 dirty form
Summary by CodeRabbit
New Features
Bug Fixes