mirror of
https://github.com/sergeyyarkov/educt-client.git
synced 2026-10-11 10:19:22 +03:00
feat: added param on fetching courses
This commit is contained in:
parent
80acb0ac7b
commit
7c5edcd190
@ -26,6 +26,7 @@ import { observer } from 'mobx-react';
|
||||
* Hooks
|
||||
*/
|
||||
import { useFetchCourses, useFetchStat } from '@educt/hooks/queries';
|
||||
import { CourseStatusEnum } from '@educt/enums';
|
||||
|
||||
/**
|
||||
* Main page
|
||||
@ -35,7 +36,7 @@ const MainPage: React.FC<IPageProps> = () => {
|
||||
userStore: { me },
|
||||
onlineStore,
|
||||
} = useRootStore();
|
||||
const { data: courses } = useFetchCourses({ limit: 3 });
|
||||
const { data: courses } = useFetchCourses({ limit: 3, status: CourseStatusEnum.PUBLISHED });
|
||||
const { data: stat } = useFetchStat();
|
||||
|
||||
if (me === null || courses === null || stat === null) return <LoadingPage />;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user