diff --git a/frontend/src/components/TopicCardList/index.tsx b/frontend/src/components/TopicCardList/index.tsx index 66674998..67f74211 100644 --- a/frontend/src/components/TopicCardList/index.tsx +++ b/frontend/src/components/TopicCardList/index.tsx @@ -9,6 +9,7 @@ import Grid from '../common/Grid'; import Space from '../common/Space'; import Text from '../common/Text'; import TopicCard from '../TopicCard'; +import useProfileList from '../../hooks/queries/useProfileList'; interface TopicCardListProps { url: string; @@ -29,11 +30,12 @@ function TopicCardList({ }: TopicCardListProps) { const [topics, setTopics] = useState(null); const { fetchGet } = useGet(); + const { data } = useProfileList(url); const getTopicsFromServer = async () => { - fetchGet(url, errorMessage, (response) => { - setTopics(response); - }); + if (data !== undefined) { + setTopics(data); + } }; useEffect(() => {