style: fix linting issues met ESLint
This commit is contained in:
parent
52364d717c
commit
fc5a40ba40
5 changed files with 8 additions and 8 deletions
|
@ -58,7 +58,7 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
|
|||
public findAllByAuthor(author: Student): Promise<Question[]> {
|
||||
return this.findAll({
|
||||
where: { author },
|
||||
orderBy: { timestamp: 'DESC' }, // new to old
|
||||
orderBy: { timestamp: 'DESC' }, // New to old
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ export async function getAllTeachers(full: boolean): Promise<TeacherDTO[]> {
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -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()}`;
|
||||
}
|
||||
|
|
|
@ -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`);}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue