feat: added param on fetching courses

This commit is contained in:
Sergey Yarkov 2022-06-13 02:35:25 +03:00
parent 80acb0ac7b
commit 7c5edcd190

View File

@ -26,6 +26,7 @@ import { observer } from 'mobx-react';
* Hooks * Hooks
*/ */
import { useFetchCourses, useFetchStat } from '@educt/hooks/queries'; import { useFetchCourses, useFetchStat } from '@educt/hooks/queries';
import { CourseStatusEnum } from '@educt/enums';
/** /**
* Main page * Main page
@ -35,7 +36,7 @@ const MainPage: React.FC<IPageProps> = () => {
userStore: { me }, userStore: { me },
onlineStore, onlineStore,
} = useRootStore(); } = useRootStore();
const { data: courses } = useFetchCourses({ limit: 3 }); const { data: courses } = useFetchCourses({ limit: 3, status: CourseStatusEnum.PUBLISHED });
const { data: stat } = useFetchStat(); const { data: stat } = useFetchStat();
if (me === null || courses === null || stat === null) return <LoadingPage />; if (me === null || courses === null || stat === null) return <LoadingPage />;