feat: frontend controller endpoints voor add en delete teacher en student van een klas
This commit is contained in:
		
							parent
							
								
									2218bb9ea5
								
							
						
					
					
						commit
						d59c61e2e2
					
				
					 1 changed files with 16 additions and 0 deletions
				
			
		|  | @ -46,10 +46,26 @@ export class ClassController extends BaseController { | ||||||
|         return this.get<StudentsResponse>(`/${id}/students`, { full }); |         return this.get<StudentsResponse>(`/${id}/students`, { full }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     async addStudent(id: string, username: string): Promise<ClassResponse> { | ||||||
|  |         return this.post<ClassResponse>(`/${id}/students`, { username }); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     async deleteStudent(id: string, username: string): Promise<ClassResponse> { | ||||||
|  |         return this.delete<ClassResponse>(`/${id}/students/${ username }`); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     async getTeachers(id: string, full = true): Promise<TeachersResponse> { |     async getTeachers(id: string, full = true): Promise<TeachersResponse> { | ||||||
|         return this.get<TeachersResponse>(`/${id}/teachers`, { full }); |         return this.get<TeachersResponse>(`/${id}/teachers`, { full }); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     async addTeacher(id: string, username: string): Promise<ClassResponse> { | ||||||
|  |         return this.post<ClassResponse>(`/${id}/teachers`, { username }); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     async deleteTeacher(id: string, username: string): Promise<ClassResponse> { | ||||||
|  |         return this.delete<ClassResponse>(`/${id}/teachers/${ username }`); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     async getTeacherInvitations(id: string, full = true): Promise<TeacherInvitationsResponse> { |     async getTeacherInvitations(id: string, full = true): Promise<TeacherInvitationsResponse> { | ||||||
|         return this.get<TeacherInvitationsResponse>(`/${id}/teacher-invitations`, { full }); |         return this.get<TeacherInvitationsResponse>(`/${id}/teacher-invitations`, { full }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Adriaan Jacquet
						Adriaan Jacquet