style: fix linting issues met Prettier

This commit is contained in:
Lint Action 2025-03-22 12:52:47 +00:00
parent d65bdd4fb4
commit fe1a6b7eea
8 changed files with 14 additions and 11 deletions

View file

@ -64,7 +64,6 @@ export async function getAssignmentsSubmissionsHandler(req: Request<AssignmentPa
const assignmentNumber = +req.params.id; const assignmentNumber = +req.params.id;
const full = req.query.full === 'true'; const full = req.query.full === 'true';
if (isNaN(assignmentNumber)) { if (isNaN(assignmentNumber)) {
res.status(400).json({ error: 'Assignment id must be a number' }); res.status(400).json({ error: 'Assignment id must be a number' });
return; return;

View file

@ -39,7 +39,7 @@ export async function createSubmissionHandler(req: Request, res: Response) {
res.status(400).json({ error: 'Failed to create submission' }); res.status(400).json({ error: 'Failed to create submission' });
return; return;
} }
res.json(submission); res.json(submission);
} }

View file

@ -57,7 +57,7 @@ export async function createTeacherHandler(req: Request, res: Response) {
const newUser = await createTeacher(userData); const newUser = await createTeacher(userData);
if (!newUser) { if (!newUser) {
res.status(400).json({ error: "Failed to create teacher" }); res.status(400).json({ error: 'Failed to create teacher' });
return; return;
} }

View file

@ -46,7 +46,7 @@ export function mapToSubmissionDTOId(submission: Submission): SubmissionDTOId {
learningObjectVersion: submission.learningObjectVersion, learningObjectVersion: submission.learningObjectVersion,
submissionNumber: submission.submissionNumber, submissionNumber: submission.submissionNumber,
} };
} }
export function mapToSubmission(submissionDTO: SubmissionDTO): Submission { export function mapToSubmission(submissionDTO: SubmissionDTO): Submission {

View file

@ -60,7 +60,11 @@ export async function getAssignment(classid: string, id: number): Promise<Assign
return mapToAssignmentDTO(assignment); return mapToAssignmentDTO(assignment);
} }
export async function getAssignmentsSubmissions(classid: string, assignmentNumber: number, full: boolean): Promise<SubmissionDTO[] | SubmissionDTOId[]> { export async function getAssignmentsSubmissions(
classid: string,
assignmentNumber: number,
full: boolean
): Promise<SubmissionDTO[] | SubmissionDTOId[]> {
const classRepository = getClassRepository(); const classRepository = getClassRepository();
const cls = await classRepository.findById(classid); const cls = await classRepository.findById(classid);

View file

@ -104,9 +104,9 @@ export async function getAllGroups(classId: string, assignmentNumber: number, fu
} }
export async function getGroupSubmissions( export async function getGroupSubmissions(
classId: string, classId: string,
assignmentNumber: number, assignmentNumber: number,
groupNumber: number, groupNumber: number,
full: boolean full: boolean
): Promise<SubmissionDTO[] | SubmissionDTOId[]> { ): Promise<SubmissionDTO[] | SubmissionDTOId[]> {
const classRepository = getClassRepository(); const classRepository = getClassRepository();

View file

@ -16,7 +16,7 @@ export async function getAllStudents(full: boolean): Promise<StudentDTO[] | stri
return students.map(mapToStudentDTO); return students.map(mapToStudentDTO);
} }
return students.map(student => student.username); return students.map((student) => student.username);
} }
export async function getStudent(username: string): Promise<StudentDTO | null> { export async function getStudent(username: string): Promise<StudentDTO | null> {

View file

@ -22,7 +22,7 @@ export async function getAllTeachers(full: boolean): Promise<TeacherDTO[] | stri
return teachers.map(mapToTeacherDTO); return teachers.map(mapToTeacherDTO);
} }
return teachers.map(teacher => teacher.username); return teachers.map((teacher) => teacher.username);
} }
export async function getTeacher(username: string): Promise<TeacherDTO | null> { export async function getTeacher(username: string): Promise<TeacherDTO | null> {
@ -87,7 +87,7 @@ export async function getClassesByTeacher(username: string, full: boolean): Prom
} }
export async function fetchStudentsByTeacher(username: string) { export async function fetchStudentsByTeacher(username: string) {
const classes = await getClassesByTeacher(username, false) as string[]; const classes = (await getClassesByTeacher(username, false)) as string[];
return (await Promise.all(classes.map(async (id) => getClassStudents(id)))).flat(); return (await Promise.all(classes.map(async (id) => getClassStudents(id)))).flat();
} }