Skip to content

Commit

Permalink
Feat: #164 캘린더 API 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
cxaosdev committed Dec 8, 2024
1 parent fbd19e9 commit 49857ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/DeleteAccountModal.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from "react";
import { FaXmark } from "react-icons/fa6";
import { useNavigate } from "react-router-dom";
import { instance } from "../api/axios";

export default function DeleteAccountModal({ onClose }) {
const navigate = useNavigate();
const handleDeleteAccount = async () => {
try {
const token = localStorage.getItem("token"); // 토큰 가져오기
Expand All @@ -15,7 +17,8 @@ export default function DeleteAccountModal({ onClose }) {
if (response.status === 200) {
alert(response.data.message); // "회원탈퇴가 완료되었습니다."
localStorage.removeItem("token"); // 토큰 제거
window.location.href = "/"; // 메인 페이지로 리다이렉트
localStorage.removeItem("refreshToken"); //refresh 토큰제거
navigate("/login");
}
} catch (error) {
console.error("회원탈퇴 중 오류 발생:", error);
Expand Down
3 changes: 1 addition & 2 deletions src/components/SideBarLeft.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function SideBarLeft() {
headers: { Authorization: `Bearer ${token}` },
}),
]);

console.log(myCalendarsResponse);
if (myCalendarsResponse.status === "fulfilled") {
setMyCalendars(myCalendarsResponse.value.data);
const initialChecked = myCalendarsResponse.value.data.reduce(
Expand Down Expand Up @@ -96,7 +96,6 @@ export default function SideBarLeft() {
},
},
);

if (response.status === 200) {
// 체크 상태 변경
setChecked((prev) => {
Expand Down

0 comments on commit 49857ca

Please sign in to comment.