feat(frontend): Frontend-controllers voor het beheren van leerpaden & verwijderen van leerobjecten aangemaakt
This commit is contained in:
		
							parent
							
								
									30ca3b70de
								
							
						
					
					
						commit
						a6e0c4bbd6
					
				
					 2 changed files with 21 additions and 0 deletions
				
			
		|  | @ -22,4 +22,8 @@ export class LearningObjectController extends BaseController { | ||||||
|     async upload(learningObjectZip: File): Promise<LearningObject> { |     async upload(learningObjectZip: File): Promise<LearningObject> { | ||||||
|         return this.postFile<LearningObject>("/", "learningObject", learningObjectZip); |         return this.postFile<LearningObject>("/", "learningObject", learningObjectZip); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     async deleteLearningObject(hruid: string, language: Language, version: number): Promise<LearningObject> { | ||||||
|  |         return this.delete<LearningObject>(`/${hruid}`, { language, version }); | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -36,4 +36,21 @@ export class LearningPathController extends BaseController { | ||||||
|         const dtos = await this.get<LearningPathDTO[]>("/", query); |         const dtos = await this.get<LearningPathDTO[]>("/", query); | ||||||
|         return dtos.map((dto) => LearningPath.fromDTO(dto)); |         return dtos.map((dto) => LearningPath.fromDTO(dto)); | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     async getAllByAdmin(admin: string): Promise<LearningPath[]> { | ||||||
|  |         const dtos = await this.get<LearningPathDTO[]>("/", { admin }); | ||||||
|  |         return dtos.map((dto) => LearningPath.fromDTO(dto)); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     async postLearningPath(learningPath: LearningPathDTO): Promise<LearningPathDTO> { | ||||||
|  |         return await this.post<LearningPathDTO>("/", learningPath); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     async putLearningPath(learningPath: LearningPathDTO): Promise<LearningPathDTO> { | ||||||
|  |         return await this.put<LearningPathDTO>(`/${learningPath.hruid}/${learningPath.language}`, learningPath); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     async deleteLearningPath(hruid: string, language: string): Promise<LearningPathDTO> { | ||||||
|  |         return await this.delete<LearningPathDTO>(`/${hruid}/${language}`); | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger