mirror of
https://github.com/sergeyyarkov/educt-client.git
synced 2026-10-11 18:29:15 +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
|
* 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 />;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user