mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
26 lines
842 B
JavaScript
26 lines
842 B
JavaScript
const
|
|
locale = 'fr',
|
|
format = 'json',
|
|
accompanying_period_id = () => window.accompanyingCourseId
|
|
;
|
|
|
|
// 1. chill_person_accompanying_course_api_show
|
|
let getAccompanyingCourse = (accompanying_period_id) => {
|
|
const url = `/${locale}/person/api/1.0/accompanying-course/${accompanying_period_id}/show.${format}`;
|
|
return fetch(url).then(response => response.json());
|
|
};
|
|
|
|
// 2. chill_person_accompanying_course_api_add_participation (POST)
|
|
let getParticipations = (accompanying_period_id) => {
|
|
const url = `/${locale}/person/api/1.0/accompanying-course/${accompanying_period_id}/participation.${format}`
|
|
return fetch(url).then(response => response.json());
|
|
};
|
|
|
|
export { getAccompanyingCourse, getParticipations };
|
|
|
|
|
|
|
|
///
|
|
// cfr. promise.all() pour plusieurs promesses
|
|
// catch throw sur le dernier then pour capturer l'erreur
|