fix: fixed linter errors

This commit is contained in:
Adriaan Jacquet 2025-04-22 17:57:18 +02:00
parent faa2f58145
commit 7f670030a7
13 changed files with 23 additions and 28 deletions

View file

@ -1,5 +1,4 @@
import {authorize} from "./auth-checks";
import {fetchAssignment} from "../../../services/assignments";
import {fetchClass} from "../../../services/classes";
import {fetchAllGroups} from "../../../services/groups";
import {mapToUsername} from "../../../interfaces/user";
@ -16,9 +15,9 @@ export const onlyAllowIfHasAccessToAssignment = authorize(
if (auth.accountType === "teacher") {
const clazz = await fetchClass(classId);
return clazz.teachers.map(mapToUsername).includes(auth.username);
} else {
}
const groups = await fetchAllGroups(classId, assignmentId);
return groups.some(group => group.members.map((member) => member.username).includes(auth.username) );
}
}
);