Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/hooks/auth/useDeleteMyAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ import { useCoreMutation } from "@/hooks/customQuery";
import { deleteMyAccount } from "@/api/auth/auth";
import useAuthStore from "@/store/useAuthStore";

const WITHDRAW_ERROR_MESSAGES: Record<string, string> = {
USER_400_9: "조직 소유권 양도를 진행한 후 탈퇴를 시도해주세요",
USER_409_1:
"소셜 정보가 없습니다. 소셜 계정으로 다시 로그인한 뒤 시도해주세요",
USER_502_1: "소셜 연동 해제에 실패했습니다. 잠시 후 다시 시도해주세요",
USER_404_1: "사용자 정보를 찾을 수 없습니다",
};

export function useDeleteMyAccount() {
const nav = useNavigate();
const queryClient = useQueryClient();
Expand All @@ -34,9 +26,7 @@ export function useDeleteMyAccount() {
userOnError: (error) => {
const apiError = error as IApiErrorResponse;
const message =
WITHDRAW_ERROR_MESSAGES[apiError.code] ??
apiError.message ??
"회원 탈퇴에 실패했습니다. 다시 시도해주세요";
apiError.message ?? "회원 탈퇴에 실패했습니다. 다시 시도해주세요";
toast.error(message);
},
});
Expand Down
Loading