refactor: tests adriaan
This commit is contained in:
		
							parent
							
								
									ded1a5908e
								
							
						
					
					
						commit
						2d841e7955
					
				
					 7 changed files with 99 additions and 178 deletions
				
			
		|  | @ -25,7 +25,7 @@ app.use(responseTime(responseTimeLogger)); | |||
| app.use('/api', apiRouter); | ||||
| 
 | ||||
| // Swagger
 | ||||
| app.use('/api-docs', swaggerUi.serve, swaggerMiddleware); | ||||
| // app.use('/api-docs', swaggerUi.serve, swaggerMiddleware);
 | ||||
| 
 | ||||
| app.use(errorHandler); | ||||
| 
 | ||||
|  |  | |||
|  | @ -62,6 +62,11 @@ export async function getAllSubmissionsHandler(req: Request, res: Response): Pro | |||
| 
 | ||||
| // TODO: gerald moet nog dingen toevoegen aan de databank voor dat dit gefinaliseerd kan worden
 | ||||
| export async function createSubmissionHandler(req: Request, res: Response): Promise<void> { | ||||
|     const submitter = req.body.submitter; | ||||
|     const usernameSubmitter = req.body.submitter.username; | ||||
|     const group = req.body.group; | ||||
|     requireFields({ group, submitter, usernameSubmitter }); | ||||
| 
 | ||||
|     const submissionDTO = req.body as SubmissionDTO; | ||||
|     const submission = await createSubmission(submissionDTO); | ||||
| 
 | ||||
|  |  | |||
|  | @ -42,7 +42,7 @@ export async function fetchStudent(username: string): Promise<Student> { | |||
|     const user = await studentRepository.findByUsername(username); | ||||
| 
 | ||||
|     if (!user) { | ||||
|         throw new NotFoundException('Student with username not found'); | ||||
|         throw new NotFoundException(`Student with username ${username} not found`); | ||||
|     } | ||||
| 
 | ||||
|     return user; | ||||
|  |  | |||
		Reference in a new issue
	
	 Gabriellvl
						Gabriellvl