Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Walkthrough탈퇴하기 기능과 역할 기반 댓글 삭제 권한, 새로운 데이터 새로고침 패턴을 구현합니다. API 레이어에 새로운 signout 엔드포인트 호출 함수를 추가하고, Redux thunk를 통해 토큰 초기화를 처리하며, 계정 설정 UI에 탈퇴 버튼을 추가합니다. 댓글 상세 컴포넌트는 사용자 프로필 정보를 수신하여 관리자 또는 작성자만 삭제 메뉴를 볼 수 있도록 제한합니다. Changes
Sequence DiagramsequenceDiagram
participant User
participant UI as accountControlSection
participant Redux as Redux Store
participant API as Auth API
participant Server as Server
User->>UI: 탈퇴하기 버튼 클릭
UI->>Redux: handleSignout() dispatch(signoutThunk())
Redux->>API: signoutThunk 시작
API->>Server: POST /auth/withdraw
Server-->>API: 성공 응답
API->>Redux: dispatch logout()
Redux->>Redux: 토큰 초기화, 사용자 상태 제거
Redux-->>UI: 상태 업데이트 완료
UI-->>User: 탈퇴 완료, 리다이렉트
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Poem
🚥 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
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
🤖 Fix all issues with AI agents
In `@src/components/pages/my/accountControlSection.tsx`:
- Around line 11-13: Add a confirmation modal and error handling around the
irreversible sign-out flow: replace the direct dispatch in handleSignout with an
async function that shows a loading state, dispatches signoutThunk inside
try/catch, closes the ConfirmModal (showConfirmModal) on success and surfaces
errors (via local error state or an existing toast/logger) on failure; add
component state (showConfirmModal) and wire the "탈퇴하기" button to
setShowConfirmModal(true) while disabling it when isLoading, and render
ConfirmModal with props open={showConfirmModal}, onClose={() =>
setShowConfirmModal(false)}, and onConfirm={handleSignout}; ensure you reference
handleSignout, signoutThunk, showConfirmModal, setShowConfirmModal, isLoading,
and ConfirmModal so the changes are easy to locate.
🧹 Nitpick comments (1)
src/components/pages/poll/Comment/commentDetail.tsx (1)
35-35:profileprop이 필수인지 선택인지 명확히 해주세요.현재
profile: Profile로 선언되어 있어 필수 prop입니다. 하지만 기존comments,voteId,onClose는 optional(?)입니다. 일관성을 위해 확인이 필요합니다.만약 profile이 없는 상황(비로그인 등)을 고려해야 한다면 optional로 변경하고 조건부 렌더링이 필요합니다.
| try { | ||
| await authApi.post('/auth/withdraw') | ||
| } catch (error) { | ||
| throw error |
There was a problem hiding this comment.
이거 받아주는 곳 있나요?
srt/store/thunks/authThunks.ts -> 여기 thunk 단에서 받아줍니다. 근데 아직 redux thunk 계층 예외 처리 전략이 없어서 딱히 뭘 하고 있진 않음.
| try { | ||
| await deleteVote(data.voteId) | ||
| setDeleteModalOpen(false) | ||
| router.back() |
There was a problem hiding this comment.
왜.. 왜 백이었죠
플로우가 게시글 클릭 -> 삭제 이거밖에 없는 줄 알았는데, 생성 페이지 -> 삭제도 있어가지고 바꿨습니다.
📝 요약
✅ 작업 내용
🧪 테스트 방법
📷 참고 자료 (스크린샷/링크/GIF 등)
🔬 관련 이슈
☝️ 참고 사항
Summary by CodeRabbit
릴리스 노트
새 기능
버그 수정
✏️ Tip: You can customize this high-level summary in your review settings.