diff --git a/bowwowcare/src/views/HomePage/HomePage.js b/bowwowcare/src/views/HomePage/HomePage.js index 539a61f..dadc26b 100644 --- a/bowwowcare/src/views/HomePage/HomePage.js +++ b/bowwowcare/src/views/HomePage/HomePage.js @@ -11,8 +11,7 @@ import anxiety from "../../assets/images/anxiety.png"; import aggression from "../../assets/images/aggression.png"; function HomePage() { - const [petlist, setPetlist] = useState([]); - const [pet, setPet] = useState([]); + const [petList, setPetList] = useState([]); const navigate = useNavigate(); const fileInput = React.useRef(null); @@ -48,30 +47,21 @@ function HomePage() { headers: authHeader(), }).then((res) => { if (res.status === 200) { - console.log(res); - setPetlist(res.data); + setPetList(res.data); } }).catch((e) => { console.log(e.message); }) }; - const getPetDetail = async () => { - const promise = petlist.map(async (v) => { - const res = await axios.get(`${API_URL}/pets/${v.petId}`); - return res.data; - }); - return Promise.all(promise).then((result) => setPet(result)); - }; useEffect(() => { getPetList(); - getPetDetail(); }, []); return (
우리 아이 이상행동 확인해보기