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[]> { |     public findAllByAuthor(author: Student): Promise<Question[]> { | ||||||
|         return this.findAll({ |         return this.findAll({ | ||||||
|             where: { author }, |             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); |     const questions = await questionRepository.findAllByAuthor(student); | ||||||
| 
 | 
 | ||||||
|     if (full) |     if (full) | ||||||
|         return questions.map(mapToQuestionDTO) |         {return questions.map(mapToQuestionDTO)} | ||||||
| 
 | 
 | ||||||
|     return questions.map(mapToQuestionId); |     return questions.map(mapToQuestionId); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ export async function getAllTeachers(full: boolean): Promise<TeacherDTO[]> { | ||||||
|     const users = await teacherRepository.findAll(); |     const users = await teacherRepository.findAll(); | ||||||
| 
 | 
 | ||||||
|     if (full) |     if (full) | ||||||
|         return users.map(mapToTeacherDTO); |         {return users.map(mapToTeacherDTO);} | ||||||
|     return users.map((user) => user.username); |     return users.map((user) => user.username); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -74,7 +74,7 @@ export async function getClassesByTeacher(username: string, full: boolean): Prom | ||||||
|     const classes = await fetchClassesByTeacher(username); |     const classes = await fetchClassesByTeacher(username); | ||||||
| 
 | 
 | ||||||
|     if (full) |     if (full) | ||||||
|         return classes; |         {return classes;} | ||||||
|     return classes.map((cls) => cls.id); |     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(); |     const students =  (await Promise.all(classes.map(async (id) => getClassStudents(id)))).flat(); | ||||||
|     if (full) |     if (full) | ||||||
|         return students |         {return students} | ||||||
|     return students.map((student) => student.username); |     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); |     const questions = await questionRepository.findAllByLearningObjects(learningObjects); | ||||||
| 
 | 
 | ||||||
|     if (full) |     if (full) | ||||||
|         return questions.map(mapToQuestionDTO); |         {return questions.map(mapToQuestionDTO);} | ||||||
| 
 | 
 | ||||||
|     return questions.map(mapToQuestionId); |     return questions.map(mapToQuestionId); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -12,7 +12,7 @@ export class BaseController { | ||||||
|         if (queryParams) { |         if (queryParams) { | ||||||
|             const query = new URLSearchParams(); |             const query = new URLSearchParams(); | ||||||
|             Object.entries(queryParams).forEach(([key, value]) => { |             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()}`; |             url += `?${query.toString()}`; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -33,5 +33,5 @@ export class TeacherController extends BaseController { | ||||||
|         return this.get<{ questions: any[] }>(`/${username}/questions`, { full }); |         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`);}
 | ||||||
| } | } | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Lint Action
						Lint Action