Skip to content

Commit

Permalink
๐Ÿšจ Fix(#239): ๋งˆ์ดํŽ˜์ด์ง€์— ์ง„์ž…๋งŒ ํ•ด๋„ ํšŒ์› ํƒˆํ‡ด ๋˜๋Š” ๋ฌธ์ œ ์ˆ˜์ •
Browse files Browse the repository at this point in the history
- ํšŒ์› ํƒˆํ‡ด api ์š”์ฒญ ํ•จ์ˆ˜ export์—์„œ ํ˜ธ์ถœ๋ถ€๋ถ„ ์ œ๊ฑฐ
- ๊ทธ ์™ธ ํ•œ์ค„ ์†Œ๊ฐœ null์ผ ์‹œ ๋ณด์—ฌ์ค„ ๋Œ€์ฒด ๋ฌธ๊ตฌ ์ถ”๊ฐ€
  • Loading branch information
sscoderati committed Nov 24, 2023
1 parent 5686938 commit f4dca65
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
22 changes: 13 additions & 9 deletions src/app/(user-menu)/mypage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,14 @@ const MyProfilePage = () => {
};

const handleDeleteAccount = async () => {
const res = await deleteMyProfile;
if (res.status === 204) {
toast({ description: "ํšŒ์› ํƒˆํ‡ด์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.", variant: "green" });
router.replace("/logout");
} else {
toast({ description: "ํšŒ์› ํƒˆํ‡ด์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.", variant: "red" });
}
deleteMyProfile().then((res) => {
if (res.status === 204) {
toast({ description: "ํšŒ์› ํƒˆํ‡ด์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.", variant: "green" });
router.replace("/logout");
} else {
toast({ description: "ํšŒ์› ํƒˆํ‡ด์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.", variant: "red" });
}
});
};

return (
Expand Down Expand Up @@ -480,7 +481,7 @@ const MyProfilePage = () => {
"justify-center text-2xl italic text-st-gray-250",
)}
>
{bio}
{bio ?? "ํ•œ ์ค„ ์†Œ๊ฐœ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”."}
<button onClick={() => setIsEditingBio(true)}>
<Icon
name="pencil"
Expand Down Expand Up @@ -534,7 +535,10 @@ const MyProfilePage = () => {
actionButton={
<Button
className={`${cn(buttonSize.sm)} bg-st-red text-st-white`}
onClick={handleDeleteAccount}
onClick={(event) => {
event.preventDefault();
handleDeleteAccount();
}}
>
ํƒˆํ‡ด
</Button>
Expand Down
2 changes: 0 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import AppBar from "@/components/_common/AppBar";
import Footer from "@/components/_common/Footer";
import "./global.css";

export const dynamic = "force-dynamic";

export const metadata: Metadata = {
title: "Steady",
description: "The New Study & Project Join Platform",
Expand Down
2 changes: 1 addition & 1 deletion src/services/user/deleteMyProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ const deleteMyProfile = async () => {
}
};

export default deleteMyProfile();
export default deleteMyProfile;

0 comments on commit f4dca65

Please sign in to comment.