From c1e1f65715680aae366f9d9f465716a1b58536a3 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 21 May 2021 16:44:59 +0200 Subject: [PATCH] action resolve commit payload, but fetch body+method --- .../Resources/public/vuejs/AccompanyingCourse/api.js | 2 +- .../public/vuejs/AccompanyingCourse/store/index.js | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js index 4acff73f6..13999d101 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js @@ -150,7 +150,7 @@ const postResource = (id, payload, method) => { * */ const postSocialIssue = (id, body, method) => { - console.log('body + method', body, method); + console.log('api body and method', body, method); const url = `/api/1.0/person/accompanying-course/${id}/socialissue.json`; return fetch(url, { method: method, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js index ec2bc9b50..1ba89a126 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -149,7 +149,7 @@ let initPromise = getAccompanyingCourse(id) })).catch((error) => { commit('catchError', error) }); }, toggleIntensity({ commit }, payload) { - console.log(payload); + //console.log(payload); patchAccompanyingCourse(id, { type: "accompanying_period", intensity: payload }) .then(course => new Promise((resolve, reject) => { commit('toggleIntensity', course.intensity); @@ -171,7 +171,7 @@ let initPromise = getAccompanyingCourse(id) })).catch((error) => { commit('catchError', error) }); }, postFirstComment({ commit }, payload) { - console.log('## action: postFirstComment: payload', payload); + //console.log('## action: postFirstComment: payload', payload); patchAccompanyingCourse(id, { type: "accompanying_period", initialComment: payload }) .then(course => new Promise((resolve, reject) => { commit('postFirstComment', course.initialComment); @@ -179,7 +179,9 @@ let initPromise = getAccompanyingCourse(id) })).catch((error) => { commit('catchError', error) }); }, updateSocialIssues({ commit }, payload) { - //postSocialIssue(id, { type: "social_issue", id: payload.id }, payload.method) + console.log('## action: payload', payload); + + //postSocialIssue(id, body, method) //.then(response => new Promise((resolve, reject) => { // console.log('response', response); commit('updateSocialIssues', payload); @@ -187,7 +189,7 @@ let initPromise = getAccompanyingCourse(id) //})).catch((error) => { commit('catchError', error) }); }, confirmAccompanyingCourse({ commit }) { - console.log('## action: confirmAccompanyingCourse'); + //console.log('## action: confirmAccompanyingCourse'); confirmAccompanyingCourse(id) .then(response => new Promise((resolve, reject) => { commit('confirmAccompanyingCourse', response);