diff --git a/src/pages/FriendListPage.tsx b/src/pages/FriendListPage.tsx index f8dd699..1a68d09 100644 --- a/src/pages/FriendListPage.tsx +++ b/src/pages/FriendListPage.tsx @@ -9,7 +9,6 @@ interface Friend { } export default function FriendListPage() { - const [friendIds, setFriendIds] = useState([]) const [friends, setFriends] = useState([]) const [showDialog, setShowDialog] = useState(false) const navigate = useNavigate() @@ -17,13 +16,8 @@ export default function FriendListPage() { useEffect(() => { const fetchFriends = async () => { try { - const ids: number[] = await api.get('/friends/list').then(res => res.data) - setFriendIds(ids) - - const friendInfos = await Promise.all( - ids.map(id => api.get(`/users/${id}`).then(res => res.data)) - ) - setFriends(friendInfos) + const res = await api.get('/friends/list') + setFriends(res.data) } catch (e) { console.error('친구 목록 불러오기 실패', e) }