style: fix linting issues met Prettier
This commit is contained in:
		
							parent
							
								
									d65bdd4fb4
								
							
						
					
					
						commit
						fe1a6b7eea
					
				
					 8 changed files with 14 additions and 11 deletions
				
			
		|  | @ -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; | ||||||
|  |  | ||||||
|  | @ -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; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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 { | ||||||
|  |  | ||||||
|  | @ -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); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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> { | ||||||
|  |  | ||||||
|  | @ -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(); | ||||||
| } | } | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Lint Action
						Lint Action