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,6 +1,6 @@
import {authorize} from "./auth-checks";
import {fetchClass, getClass} from "../../../services/classes";
import {fetchGroup, getGroup} from "../../../services/groups";
import {fetchClass} from "../../../services/classes";
import {fetchGroup} from "../../../services/groups";
import {mapToUsername} from "../../../interfaces/user";
/**
@ -17,9 +17,9 @@ export const onlyAllowIfHasAccessToGroup = authorize(
if (auth.accountType === "teacher") {
const clazz = await fetchClass(classId);
return clazz.teachers.map(mapToUsername).includes(auth.username);
} else { // user is student
} // User is student
const group = await fetchGroup(classId, assignmentId, groupId);
return group.members.map(mapToUsername).includes(auth.username);
}
}
);