Refactoring: cursus -> curriculum frontend
I hope I didn't missed anything, this commit is following the previous one in this branch
This commit is contained in:
41
frontend/src/rest/curriculum.js
Normal file
41
frontend/src/rest/curriculum.js
Normal file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* curriculum API
|
||||
*/
|
||||
|
||||
import { restGet, restPostn, restDelete, restPatch } from './restConsumer.js'
|
||||
|
||||
/**
|
||||
* Create a new curriculum (bundle of courses)
|
||||
* @param courses list of courses
|
||||
*/
|
||||
export async function createcurriculum(courses){
|
||||
return restPost("/curriculum", {courses: courses} );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the specified curriculum
|
||||
*/
|
||||
export async function deletecurriculum(id){
|
||||
return restDelete("/curriculum/" + id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get informations on a particular curriculum
|
||||
*
|
||||
* @param id identification of the curriculum
|
||||
*
|
||||
* @return list of courses
|
||||
*/
|
||||
export async function getcurriculum(id){
|
||||
return restGet("/curriculum/" + id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify the courses of a curriculum
|
||||
*
|
||||
* @param id the id of the curriculum
|
||||
* @param courses list of new courses
|
||||
*/
|
||||
export async function altercurriculum(id, courses){
|
||||
return restPatch("/curriculum/" + id, courses);
|
||||
}
|
Reference in New Issue
Block a user