From 35112a216616b978639054fbed2e119370cab500 Mon Sep 17 00:00:00 2001 From: choi Date: Mon, 23 Dec 2024 22:47:56 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/user/[userId]/page.tsx | 4 +-- src/components/modal/confirm-modal.tsx | 40 ++++++++++++++------------ src/components/ui/checkbox.tsx | 2 +- src/services/profileService.ts | 2 +- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/app/user/[userId]/page.tsx b/src/app/user/[userId]/page.tsx index 6e2744e..166e083 100644 --- a/src/app/user/[userId]/page.tsx +++ b/src/app/user/[userId]/page.tsx @@ -105,12 +105,12 @@ export default function UserPage() { - + 프로필 편집 handleConfirm(profileData?.uuid || "")} > 프로필 삭제 diff --git a/src/components/modal/confirm-modal.tsx b/src/components/modal/confirm-modal.tsx index c036e33..c7142b3 100644 --- a/src/components/modal/confirm-modal.tsx +++ b/src/components/modal/confirm-modal.tsx @@ -35,7 +35,9 @@ const ConfirmModal = () => { const uuid = confirmModal.uuid; const response = await deleteProfile(uuid); - if (!response?.data) { + console.log(response); + + if (!response) { throw new Error("프로필 삭제에 실패했습니다."); } @@ -48,11 +50,11 @@ const ConfirmModal = () => { toast.error( error.response?.data?.message || error.response?.data?.detail || - "프로필 삭제 중 오류가 발생했습니다." + "프로필 수정 중 오류가 발생했습니다." ); } else { console.error("에러 상세:", error); - toast.error("프로필 삭제 과정에서 오류가 발생했습니다."); + toast.error("프로필 수정 과정에서 오류가 발생했습니다."); } } finally { setLoading(false); @@ -63,47 +65,49 @@ const ConfirmModal = () => { } - title="프로필 삭제" + icon={} + title="경고" /> } - description="이 작업은 되돌릴 수 없습니다. 삭제된 프로필은 복구할 수 없습니다." + description="이 작업은 되돌릴 수 없습니다. 계속하시겠습니까?" isOpen={confirmModal.isOpen} onChange={onChange} - className="p-6 flex flex-col items-center justify-center max-w-md mx-auto" + className="p-4 flex flex-col items-center justify-center h-[50%]" > -
-
+
+
setChecked(!checked)} disabled={loading} - className="mt-1" />
-
+
diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx index f941ea7..936cf4f 100644 --- a/src/components/ui/checkbox.tsx +++ b/src/components/ui/checkbox.tsx @@ -12,7 +12,7 @@ const Checkbox = React.forwardRef< { const response = await api.delete(`/profile/${uuid}`); if (response.status >= 200 && response.status < 300) { - return response.data; + return response.status; } return null;