-
Notifications
You must be signed in to change notification settings - Fork 2
[DEV] 회원 탈퇴 api 연동 #266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[DEV] 회원 탈퇴 api 연동 #266
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1101034
feat: 회원 탈퇴 api 요청 함수 추가
sejeong223 c3801bb
fix: 파일 이름 오타 수정
sejeong223 b02cff6
feat: 회원 탈퇴 api 연동
sejeong223 9e31233
feat: 회원 탈퇴 처리 중 모달 닫기 방지 로직 추가
sejeong223 1a293ea
Merge branch 'develop' into dev/api-withdraw
drddyn d8b9352
chore: App.tsx에서 GoogleAnalytics 삭제
drddyn f94445d
feat: 로그아웃 상태일 시 탈퇴 모달 닫히게 설정
drddyn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { useQueryClient } from '@tanstack/react-query' | ||
| import { useNavigate } from 'react-router-dom' | ||
| import { useAuthStore } from '../../stores/authStore' | ||
| import { useWithdrawMember } from './userMutations' | ||
|
|
||
| export function useWithdrawSettings() { | ||
| const navigate = useNavigate() | ||
| const queryClient = useQueryClient() | ||
| const clearAuth = useAuthStore((state) => state.actions.clearAuth) | ||
| const { mutate: withdraw, isPending } = useWithdrawMember() | ||
|
|
||
| const confirmWithdraw = () => { | ||
| if (isPending) return | ||
|
|
||
| withdraw(undefined, { | ||
| onSuccess: () => { | ||
| queryClient.clear() | ||
| clearAuth() | ||
| navigate('/') | ||
| }, | ||
| onError: () => { | ||
| alert('회원 탈퇴에 실패했습니다.') | ||
| }, | ||
| }) | ||
| } | ||
|
|
||
| return { | ||
| confirmWithdraw, | ||
| isPending, | ||
| } | ||
| } | ||
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사용자 경험을 위해
alert대신 토스트나 스낵바와 같은 UI 컴포넌트를 사용하여 에러 메시지를 표시하는 것을 고려해보세요.alert는 브라우저의 기본 기능을 사용하여 사용자 인터페이스의 일관성을 해치고, 사용자 경험을 저해할 수 있습니다.