From fcfe2ab6ec0dec0db4d94f6c7218d8f2dbb0c2d8 Mon Sep 17 00:00:00 2001 From: jeffvli Date: Tue, 10 Aug 2021 05:46:41 -0700 Subject: [PATCH] update dashboard --- src/components/dashboard/Dashboard.tsx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/components/dashboard/Dashboard.tsx b/src/components/dashboard/Dashboard.tsx index 692942d..cf37eaf 100644 --- a/src/components/dashboard/Dashboard.tsx +++ b/src/components/dashboard/Dashboard.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { getAlbumList } from '../../api/api'; +import { getAlbums } from '../../api/api'; import Loader from '../loader/Loader'; import GenericPage from '../layout/GenericPage'; import GenericPageHeader from '../layout/GenericPageHeader'; @@ -21,13 +21,10 @@ const Dashboard = () => { const fetchData = async () => { setIsLoading(true); try { - const newest = await getAlbumList({ type: 'newest', size: 20 }, 250); - const recent = await getAlbumList({ type: 'recent', size: 20 }, 250); - const random = await getAlbumList({ type: 'random', size: 20 }, 250); - const frequent = await getAlbumList( - { type: 'frequent', size: 20 }, - 250 - ); + const newest = await getAlbums({ type: 'newest', size: 20 }, 250); + const recent = await getAlbums({ type: 'recent', size: 20 }, 250); + const random = await getAlbums({ type: 'random', size: 20 }, 250); + const frequent = await getAlbums({ type: 'frequent', size: 20 }, 250); setNewestAlbums(newest); setRecentAlbums(recent); @@ -60,15 +57,15 @@ const Dashboard = () => { {newestAlbums && recentAlbums && randomAlbums && ( <>