@@ -63,11 +63,11 @@ export function useStudentsForStudentList({
6363 const { enqueueSnackbar } = useSnackbar ( ) ;
6464
6565 const [ students , , , fetchStudents ] = useFetchState ( {
66- fetchFunction : async ( ) => {
66+ fetchFunction : async ( tutorialId : string ) => {
6767 return tutorialId === undefined ? getAllStudents ( ) : getStudentsOfTutorial ( tutorialId ) ;
6868 } ,
6969 immediate : true ,
70- params : [ ] ,
70+ params : [ tutorialId ?? '' ] ,
7171 } ) ;
7272
7373 const [ summaries = { } , isLoadingSummaries ] = useFetchState ( {
@@ -92,7 +92,7 @@ export function useStudentsForStudentList({
9292 dto . team = teamId !== '' ? teamId : undefined ;
9393 const student = await fetchCreateStudent ( dto ) ;
9494 await fetchTeams ( tutorialId ?? '' ) ;
95- await fetchStudents ( ) ;
95+ await fetchStudents ( tutorialId ?? '' ) ;
9696
9797 enqueueSnackbar ( `${ student . nameFirstnameFirst } wurde erfolgreich erstellt.` , {
9898 variant : 'success' ,
@@ -119,7 +119,7 @@ export function useStudentsForStudentList({
119119
120120 await fetchEditStudent ( studentId , studentDTO ) ;
121121 await fetchTeams ( tutorialId ?? '' ) ;
122- await fetchStudents ( ) ;
122+ await fetchStudents ( tutorialId ?? '' ) ;
123123
124124 enqueueSnackbar ( `${ student . nameFirstnameFirst } wurde erfolgreich gespeichert.` , {
125125 variant : 'success' ,
@@ -137,7 +137,7 @@ export function useStudentsForStudentList({
137137 async ( student : Student ) => {
138138 try {
139139 await fetchDeleteStudent ( student . id ) ;
140- await fetchStudents ( ) ;
140+ await fetchStudents ( tutorialId ?? '' ) ;
141141
142142 enqueueSnackbar ( `${ student . nameFirstnameFirst } wurde erfolgreich gelöscht.` , {
143143 variant : 'success' ,
0 commit comments