| 
									
										
										
										
											2024-03-06 22:57:01 +01:00
										 |  |  | /** | 
					
						
							|  |  |  |  * cursus API | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-06 23:10:29 +01:00
										 |  |  | import { restGet, restPostn, restDelete, restPatch } from './restConsumer.js' | 
					
						
							| 
									
										
										
										
											2024-03-06 22:57:01 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Create a new cursus (bundle of courses) | 
					
						
							|  |  |  |  * @param courses	list of courses | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export async function createCursus(courses){ | 
					
						
							|  |  |  | 	return restPost("/cursus", {courses: courses} ); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Delete the specified cursus | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export async function deleteCursus(id){ | 
					
						
							|  |  |  | 	return restDelete("/cursus/" + id); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Get informations on a particular cursus | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @param id	identification of the cursus | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @return list of courses  | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export async function getCursus(id){ | 
					
						
							|  |  |  | 	return restGet("/cursus/" + id); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Modify the courses of a cursus | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @param id		the id of the cursus | 
					
						
							|  |  |  |  * @param courses	list of new courses  | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export async function alterCursus(id, courses){ | 
					
						
							|  |  |  | 	return restPatch("/cursus/" + id, courses); | 
					
						
							|  |  |  | } |