LeoMoulin
3c721de18b
make some changes to profile to provide an interface for a student to manage his courses. implements the submission of exemptions request
71 lines
1.6 KiB
JavaScript
71 lines
1.6 KiB
JavaScript
/**
|
|
* curriculum API
|
|
*/
|
|
|
|
import { restGet, restPost, 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);
|
|
}
|
|
|
|
export async function getAllCurriculums(){
|
|
return restGet("/curriculums");
|
|
}
|
|
|
|
/**
|
|
* 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);
|
|
}
|
|
|
|
|
|
export async function getSelfCurriculum(){
|
|
return restGet("/curriculum");
|
|
}
|
|
|
|
export async function getSomeonesCurriculumList(user){
|
|
return restGet("/onescurriculum/"+user)
|
|
}
|
|
|
|
export async function createExternalCurriculum(inscriptionRequestId,school, formation, completion, startYear, endYear, justifdocUrl){
|
|
return restPost("/externalcurriculum", {
|
|
inscriptionRequestId: inscriptionRequestId,
|
|
school:school,
|
|
formation :formation,
|
|
completion : completion,
|
|
startYear : startYear,
|
|
endYear: endYear,
|
|
justifdocUrl : justifdocUrl
|
|
})
|
|
}
|
|
|
|
export async function getExternalCurriculumListByInscrReq(inscriptionRequestId){
|
|
return restGet("/externalCurriculum/"+parseInt(inscriptionRequestId))
|
|
}
|