Skip to content

Commit

Permalink
๐Ÿ› Fix: reload on phone number update
Browse files Browse the repository at this point in the history
  • Loading branch information
ilp-sys committed May 28, 2024
1 parent 8f2a1e0 commit 9fcd553
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions aeye/app/(nav)/my/profileMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import { useRecoilState } from "recoil";
import { useRecoilValue } from "recoil";
import { memberState } from "@/app/recoil-states";
import {
Paper,
Expand All @@ -15,7 +15,7 @@ import KakaoIcon from "@/app/kakao";
import GoogleIcon from "@/app/google";

export default function ProfileMenu() {
const [member, setMember] = useRecoilState(memberState);
const member = useRecoilValue(memberState);
const [phone, setPhone] = useState("");

const handleClick = async () => {
Expand All @@ -25,7 +25,15 @@ export default function ProfileMenu() {
"Content-Type": "application/json",
},
body: JSON.stringify({ phone }),
}).catch((error) => console.error(error));
})
.then((response) => response.json())
.then((jsonData) => {
if (jsonData.code == 204) {
alert("์ „ํ™”๋ฒˆํ˜ธ๊ฐ€ ๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.");
location.reload();
}
})
.catch((error) => console.error(error));
};

return (
Expand Down

0 comments on commit 9fcd553

Please sign in to comment.