style: fix linting issues met Prettier

This commit is contained in:
Lint Action 2025-04-17 17:08:18 +00:00
parent 205a4addad
commit 7f782915b6
12 changed files with 30 additions and 32 deletions

View file

@ -58,17 +58,16 @@ export async function createAssignment(classid: string, assignmentData: Assignme
const assignment = mapToAssignment(assignmentData, cls);
await assignmentRepository.save(assignment);
if (assignmentData.groups) {
/*
For some reason when trying to add groups, it does not work when using the original assignment variable.
The assignment needs to be refetched in order for it to work.
*/
const assignmentCopy = await assignmentRepository.findByClassAndId(cls, assignment.id!);
if (assignmentCopy === null) {
throw new ServerErrorException("Something has gone horribly wrong. Could not find newly added assignment which is needed to add groups.");
throw new ServerErrorException('Something has gone horribly wrong. Could not find newly added assignment which is needed to add groups.');
}
const groupRepository = getGroupRepository();

View file

@ -68,7 +68,7 @@ export async function createGroup(groupData: GroupDTO, classid: string, assignme
const groupRepository = getGroupRepository();
const newGroup = groupRepository.create({
assignment: assignment,
members: members
members: members,
});
await groupRepository.save(newGroup);
@ -83,10 +83,10 @@ export async function getAllGroups(classId: string, assignmentNumber: number, fu
const groups = await groupRepository.findAllGroupsForAssignment(assignment);
if (full) {
return groups.map(group => mapToGroupDTO(group, assignment.within));
return groups.map((group) => mapToGroupDTO(group, assignment.within));
}
return groups.map(group => mapToGroupDTOId(group, assignment.within));
return groups.map((group) => mapToGroupDTOId(group, assignment.within));
}
export async function getGroupSubmissions(

View file

@ -104,10 +104,10 @@ export async function getStudentGroups(username: string, full: boolean): Promise
const groups = await groupRepository.findAllGroupsWithStudent(student);
if (full) {
return groups.map(group => mapToGroupDTO(group, group.assignment.within));
return groups.map((group) => mapToGroupDTO(group, group.assignment.within));
}
return groups.map(group => mapToGroupDTOId(group, group.assignment.within));
return groups.map((group) => mapToGroupDTOId(group, group.assignment.within));
}
export async function getStudentSubmissions(username: string, full: boolean): Promise<SubmissionDTO[] | SubmissionDTOId[]> {