diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js index 2c136ac16..8e49a2e21 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js @@ -1,5 +1,5 @@ -const getBodyTypeId = (payload) => { +const getEntityTypeId = (payload) => { const body = {}; if (payload !== null) { body['type'] = payload.type; @@ -56,7 +56,7 @@ const patchAccompanyingCourse = (id, body) => { * @method string - POST or DELETE */ const postParticipation = (id, payload, method) => { - const body = getBodyTypeId(payload); + const body = getEntityTypeId(payload); const url = `/api/1.0/person/accompanying-course/${id}/participation.json`; return fetch(url, { method: method, @@ -80,7 +80,7 @@ const postParticipation = (id, payload, method) => { * @method string - POST or DELETE */ const postRequestor = (id, payload, method) => { - const body = getBodyTypeId(payload); + const body = getEntityTypeId(payload); const url = `/api/1.0/person/accompanying-course/${id}/requestor.json`; return fetch(url, { method: method, @@ -104,7 +104,14 @@ const postRequestor = (id, payload, method) => { * @method string - POST or DELETE */ const postResource = (id, payload, method) => { - const body = getBodyTypeId(payload); + console.log('payload', payload); + const body = { type: "accompanying_period_resource" }; + if (method === 'DELETE') { + body['id'] = payload.id; + } else { + body['resource'] = getEntityTypeId(payload); + } + console.log('body', body); const url = `/api/1.0/person/accompanying-course/${id}/resource.json`; return fetch(url, { method: method, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/InterlocutorItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/InterlocutorItem.vue index 75222fc52..ecc0e7727 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/InterlocutorItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/InterlocutorItem.vue @@ -1,14 +1,10 @@