diff --git a/frontend/src/api/students.ts b/frontend/src/api/students.ts index a8f9c98..083fae8 100644 --- a/frontend/src/api/students.ts +++ b/frontend/src/api/students.ts @@ -22,6 +22,7 @@ export const getStudents = ( order_by_last_name: OrderType page: number per_page: number + mode: boolean }> = {}, ) => axiosInstance.get( diff --git a/frontend/src/views/coordinator/Students.tsx b/frontend/src/views/coordinator/Students.tsx index 11a6492..322ebec 100644 --- a/frontend/src/views/coordinator/Students.tsx +++ b/frontend/src/views/coordinator/Students.tsx @@ -9,6 +9,8 @@ const Students = () => { const [showGroupless, setShowGroupless] = useState(false) const [page, setPage] = useState(1) const [perPage, setPerPage] = useState(10) + const [mode, setMode] = useState(true) + const perPageOptions = [ { value: 10, @@ -32,8 +34,8 @@ const Students = () => { isLoading: isStudentsLoading, data: students, refetch: refetchStudents, - } = useQuery(['students', page, perPage], () => - getStudents({ page, per_page: perPage }), + } = useQuery(['students', page, perPage, mode], () => + getStudents({ page, per_page: perPage, mode }), ) const { mutate: mutateUpload } = useMutation( @@ -53,7 +55,7 @@ const Students = () => { useEffect(() => { setPage(1) - }, [perPage]) + }, [perPage, mode]) return (
@@ -88,6 +90,15 @@ const Students = () => { ))} +