2024-03-16 10:17:04 +01:00
|
|
|
/**
|
|
|
|
* curriculum API
|
|
|
|
*/
|
|
|
|
|
2024-03-16 12:47:49 +01:00
|
|
|
import { restGet, restPost, restDelete, restPatch } from './restConsumer.js'
|
2024-03-16 10:17:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
}
|
|
|
|
|
2024-03-16 12:47:49 +01:00
|
|
|
export async function getAllCurriculums(){
|
2024-03-17 13:24:24 +01:00
|
|
|
return restGet("/curriculums");
|
2024-03-16 12:47:49 +01:00
|
|
|
}
|
|
|
|
|
2024-03-16 10:17:04 +01:00
|
|
|
/**
|
|
|
|
* 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);
|
|
|
|
}
|
2024-03-18 17:28:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
export async function getSelfCurriculum(){
|
|
|
|
return restGet("/curriculum");
|
|
|
|
}
|
2024-03-25 09:57:35 +01:00
|
|
|
|
|
|
|
export async function getSomeonesCurriculumList(user){
|
|
|
|
return restGet("/onescurriculum/"+user)
|
|
|
|
}
|
2024-04-04 16:54:11 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
})
|
|
|
|
}
|
2024-04-06 16:12:11 +02:00
|
|
|
|
|
|
|
export async function getExternalCurriculumListByInscrReq(inscriptionRequestId){
|
|
|
|
return restGet("/externalCurriculum/"+parseInt(inscriptionRequestId))
|
|
|
|
}
|