From fc5a40ba40e25b7c08fba2535061a8eb8b0980b2 Mon Sep 17 00:00:00 2001 From: Lint Action Date: Fri, 21 Mar 2025 22:26:24 +0000 Subject: [PATCH] style: fix linting issues met ESLint --- backend/src/data/questions/question-repository.ts | 2 +- backend/src/services/students.ts | 2 +- backend/src/services/teachers.ts | 8 ++++---- frontend/src/controllers/base-controller.ts | 2 +- frontend/src/controllers/teacher-controller.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/src/data/questions/question-repository.ts b/backend/src/data/questions/question-repository.ts index 8789c2e9..78d3a6ef 100644 --- a/backend/src/data/questions/question-repository.ts +++ b/backend/src/data/questions/question-repository.ts @@ -58,7 +58,7 @@ export class QuestionRepository extends DwengoEntityRepository { public findAllByAuthor(author: Student): Promise { return this.findAll({ where: { author }, - orderBy: { timestamp: 'DESC' }, // new to old + orderBy: { timestamp: 'DESC' }, // New to old }); } diff --git a/backend/src/services/students.ts b/backend/src/services/students.ts index 70bed549..f7a7cbcc 100644 --- a/backend/src/services/students.ts +++ b/backend/src/services/students.ts @@ -139,7 +139,7 @@ export async function getStudentQuestions(username: string, full: boolean): Prom const questions = await questionRepository.findAllByAuthor(student); if (full) - return questions.map(mapToQuestionDTO) + {return questions.map(mapToQuestionDTO)} return questions.map(mapToQuestionId); } diff --git a/backend/src/services/teachers.ts b/backend/src/services/teachers.ts index 5b0d8144..5e1ea2cb 100644 --- a/backend/src/services/teachers.ts +++ b/backend/src/services/teachers.ts @@ -15,7 +15,7 @@ export async function getAllTeachers(full: boolean): Promise { const users = await teacherRepository.findAll(); if (full) - return users.map(mapToTeacherDTO); + {return users.map(mapToTeacherDTO);} return users.map((user) => user.username); } @@ -74,7 +74,7 @@ export async function getClassesByTeacher(username: string, full: boolean): Prom const classes = await fetchClassesByTeacher(username); if (full) - return classes; + {return classes;} return classes.map((cls) => cls.id); } @@ -83,7 +83,7 @@ export async function getStudentsByTeacher(username: string, full: boolean) { const students = (await Promise.all(classes.map(async (id) => getClassStudents(id)))).flat(); if (full) - return students + {return students} return students.map((student) => student.username); } @@ -103,7 +103,7 @@ export async function getTeacherQuestions(username: string, full: boolean): Prom const questions = await questionRepository.findAllByLearningObjects(learningObjects); if (full) - return questions.map(mapToQuestionDTO); + {return questions.map(mapToQuestionDTO);} return questions.map(mapToQuestionId); } diff --git a/frontend/src/controllers/base-controller.ts b/frontend/src/controllers/base-controller.ts index 8005a32e..e14dba23 100644 --- a/frontend/src/controllers/base-controller.ts +++ b/frontend/src/controllers/base-controller.ts @@ -12,7 +12,7 @@ export class BaseController { if (queryParams) { const query = new URLSearchParams(); Object.entries(queryParams).forEach(([key, value]) => { - if (value !== undefined && value !== null) query.append(key, value.toString()); + if (value !== undefined && value !== null) {query.append(key, value.toString());} }); url += `?${query.toString()}`; } diff --git a/frontend/src/controllers/teacher-controller.ts b/frontend/src/controllers/teacher-controller.ts index d3273ac1..fea08419 100644 --- a/frontend/src/controllers/teacher-controller.ts +++ b/frontend/src/controllers/teacher-controller.ts @@ -33,5 +33,5 @@ export class TeacherController extends BaseController { return this.get<{ questions: any[] }>(`/${username}/questions`, { full }); } - // getInvitations(id: string) {return this.get<{ invitations: string[] }>(`/${id}/invitations`);} + // GetInvitations(id: string) {return this.get<{ invitations: string[] }>(`/${id}/invitations`);} }