Skip to content

Commit

Permalink
Merge pull request #205 from LikeLion-at-DGU/dev
Browse files Browse the repository at this point in the history
🚀 Deploy
  • Loading branch information
Chaem03 authored Aug 3, 2024
2 parents fab4651 + 5d0a08a commit b0c33db
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/hooks/useMyInfo.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import { useState, useEffect } from "react";
import { getMyPContent } from "../apis/mypage";

export const useMyInfo = async () => {
export const useMyInfo = () => {
const [myinfo, setMyinfo] = useState(null);
const fetchMyInfo = async () => {
try {
const res = await getMyPContent();
console.log("myinfo:", res);
setMyinfo(res);
} catch (err) {
console.log(err);
}
};

try {
const res = await getMyPContent();
console.log("myinfo:", res);
setMyinfo(res);
} catch (err) {
console.log(err);
}
useEffect(() => {
fetchMyInfo();
}, []);

return { myinfo };
};

0 comments on commit b0c33db

Please sign in to comment.