feat: teacher invitation databank api verbinding aangemaakt, bug in data repo waar teacher invitation repo niet juist werd teruggegeven gefixt
This commit is contained in:
		
							parent
							
								
									cfd0cce2df
								
							
						
					
					
						commit
						baf43e91de
					
				
					 6 changed files with 92 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
import { Request, Response } from 'express';
 | 
			
		||||
import { getAllClasses, getClass, getClassStudents } from '../services/class';
 | 
			
		||||
import { getAllClasses, getClass, getClassStudents, getClassTeacherInvitations } from '../services/class';
 | 
			
		||||
import { ClassDTO } from '../interfaces/classes';
 | 
			
		||||
 | 
			
		||||
export async function getAllClassesHandler(
 | 
			
		||||
| 
						 | 
				
			
			@ -53,4 +53,18 @@ export async function getClassStudentsHandler(
 | 
			
		|||
    res.json({
 | 
			
		||||
        students: students,
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export async function getTeacherInvitationsHandler(
 | 
			
		||||
    req: Request,
 | 
			
		||||
    res: Response,
 | 
			
		||||
): Promise<void> {
 | 
			
		||||
    const classId = req.params.id;
 | 
			
		||||
    const full = req.query.full === "true"; // TODO: not implemented yet
 | 
			
		||||
    
 | 
			
		||||
    const invitations = await getClassTeacherInvitations(classId, full);
 | 
			
		||||
 | 
			
		||||
    res.json({
 | 
			
		||||
        invitations: invitations,
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
		Reference in a new issue