마이페이지 계정 탈퇴 API 연동#701
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 23 minutes and 27 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 Walkthrough요약탈퇴 모달에서 미완성 TODO 로직을 실제 변경 사항회원 탈퇴 플로우 구현
관련 PR
시
🎯 2 (Simple) | ⏱️ ~10분 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/hooks/queries/user/use-withdraw-member-mutation.ts`:
- Around line 18-19: The onError in use-withdraw-member-mutation.ts currently
calls showToast directly; change it to delegate to the centralized error handler
in utils/error-handler.ts instead. Update the onError signature to accept the
error parameter and call the exported handler (e.g., handleError or the
project’s error handler function) passing the error so the handler can use
useToastStore; remove the direct showToast usage and any hardcoded message so
all toast/message logic flows through utils/error-handler.ts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8a000b77-e325-4173-bdf5-817156b08fef
📒 Files selected for processing (2)
src/app/(service)/(my)/my-page/_components/withdrawal-confirm-modal.tsxsrc/hooks/queries/user/use-withdraw-member-mutation.ts
| onError: () => { | ||
| showToast('탈퇴에 실패했습니다. 잠시 후 다시 시도해주세요.', 'error'); |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
에러 처리를 utils/error-handler.ts 경유로 통일해 주세요.
현재 onError에서 토스트를 직접 호출하고 있어 공통 에러 처리 경로를 우회합니다. 이 훅도 에러 핸들러 유틸을 통해 토스트/메시지 처리를 위임하는 형태로 맞춰 주세요.
As per coding guidelines, "All errors must be handled via utils/error-handler.ts — never use alert(), always use useToastStore."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/hooks/queries/user/use-withdraw-member-mutation.ts` around lines 18 - 19,
The onError in use-withdraw-member-mutation.ts currently calls showToast
directly; change it to delegate to the centralized error handler in
utils/error-handler.ts instead. Update the onError signature to accept the error
parameter and call the exported handler (e.g., handleError or the project’s
error handler function) passing the error so the handler can use useToastStore;
remove the direct showToast usage and any hardcoded message so all toast/message
logic flows through utils/error-handler.ts.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Problem
마이페이지 > 프로필의 '계정 탈퇴' 버튼은 UI만 존재하고 실제 API 연동이 없었음. 탈퇴하기 클릭 시 아무런 동작이 발생하지 않는 상태.
Solution
DELETE /api/v6/mypage/class/withdraw엔드포인트를 연동. 탈퇴 성공 시clearClientAuthStateAndRedirect('/')호출로 모든 클라이언트 상태(쿠키, Zustand 스토어, QueryCache)를 초기화하고 랜딩 페이지로 리다이렉트.에러 핸들링은
useMutation레벨onError에 정의 — call-time 콜백 방식은MutationCache.onErrorglobal 핸들러가 suppress되지 않아 에러 토스트가 2번 표시되는 문제가 있어 hook 레벨에서 처리.Changes
Features
src/hooks/queries/user/use-withdraw-member-mutation.tssrc/app/(service)/(my)/my-page/_components/withdrawal-confirm-modal.tsxResult
/리다이렉트Test plan
/) 리다이렉트, 로그인 상태 해제 확인🤖 Generated with Claude Code
Summary by CodeRabbit
릴리스 노트
새로운 기능
버그 수정