diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api/accompanyingCourse.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api/accompanyingCourse.js index 0448ba459..8c7106b1e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api/accompanyingCourse.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api/accompanyingCourse.js @@ -4,7 +4,7 @@ const accompanying_period_id = () => window.accompanyingCourseId ; -// 1. chill_person_accompanying_course_api_show +// 1. chill_person_accompanying_course_api_show (GET) let getAccompanyingCourse = (accompanying_period_id) => { const url = `/${locale}/person/api/1.0/accompanying-course/${accompanying_period_id}/show.${format}`; return fetch(url) @@ -12,15 +12,19 @@ let getAccompanyingCourse = (accompanying_period_id) => { }; // 2. chill_person_accompanying_course_api_add_participation (POST) -let getParticipations = (accompanying_period_id) => { +let postParticipation = (accompanying_period_id, participation) => { const url = `/${locale}/person/api/1.0/accompanying-course/${accompanying_period_id}/participation.${format}` - return fetch(url) + return fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json;charset=utf-8' + }, + body: JSON.stringify(participation) + }) .then(response => response.json()); }; -export { getAccompanyingCourse, getParticipations }; - - +export { getAccompanyingCourse, postParticipation }; /// TODO // * cfr. promise.all() pour plusieurs promesses diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonItem.vue index 45d39064a..93b3b1d6e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonItem.vue @@ -11,14 +11,16 @@ -