fix: fixed linter errors
This commit is contained in:
parent
faa2f58145
commit
7f670030a7
13 changed files with 23 additions and 28 deletions
|
@ -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) );
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue