fix: requireFields toegevoegd op plaatsen
This commit is contained in:
		
							parent
							
								
									dde672befd
								
							
						
					
					
						commit
						441b77b8cd
					
				
					 3 changed files with 2 additions and 1 deletions
				
			
		|  | @ -7,7 +7,6 @@ import {BadRequestException} from "../exceptions/bad-request-exception"; | ||||||
| export async function getAllAssignmentsHandler(req: Request, res: Response): Promise<void> { | export async function getAllAssignmentsHandler(req: Request, res: Response): Promise<void> { | ||||||
|     const classId = req.params.classid; |     const classId = req.params.classid; | ||||||
|     const full = req.query.full === 'true'; |     const full = req.query.full === 'true'; | ||||||
|     requireFields({ classId }); |  | ||||||
| 
 | 
 | ||||||
|     const assignments = await getAllAssignments(classId, full); |     const assignments = await getAllAssignments(classId, full); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -3,6 +3,7 @@ import { createGroup, getAllGroups, getGroup, getGroupSubmissions } from '../ser | ||||||
| import { GroupDTO } from '@dwengo-1/common/interfaces/group'; | import { GroupDTO } from '@dwengo-1/common/interfaces/group'; | ||||||
| import { requireFields } from './error-helper.js'; | import { requireFields } from './error-helper.js'; | ||||||
| import { BadRequestException } from '../exceptions/bad-request-exception.js'; | import { BadRequestException } from '../exceptions/bad-request-exception.js'; | ||||||
|  | import { getLogger } from '../logging/initalize.js'; | ||||||
| 
 | 
 | ||||||
| export async function getGroupHandler(req: Request, res: Response): Promise<void> { | export async function getGroupHandler(req: Request, res: Response): Promise<void> { | ||||||
|     const classId = req.params.classid; |     const classId = req.params.classid; | ||||||
|  |  | ||||||
|  | @ -38,6 +38,7 @@ export async function getAllSubmissionsHandler(req: Request, res: Response): Pro | ||||||
|     res.json({ submissions }); |     res.json({ submissions }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | // 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> { | export async function createSubmissionHandler(req: Request, res: Response): Promise<void> { | ||||||
|     const submissionDTO = req.body as SubmissionDTO; |     const submissionDTO = req.body as SubmissionDTO; | ||||||
|     const submission = await createSubmission(submissionDTO); |     const submission = await createSubmission(submissionDTO); | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Adriaan Jacquet
						Adriaan Jacquet