Skip to content

Commit 2b4ac60

Browse files
authored
Merge pull request #1047 from TMS-Uni-Stuttgart/zeliadev
Fix lists are not updated with new group data when switching groups within the same view
2 parents 0ed1486 + 60d1b72 commit 2b4ac60

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

client/src/pages/studentmanagement/student-list/StudentList.helpers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)