From 132f11298ec975ffbb0081c511fe945f17fdb2ef Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Fri, 21 May 2021 16:59:38 +0200 Subject: [PATCH] now i have to find id+method from payload --- .../vuejs/AccompanyingCourse/components/SocialIssue.vue | 8 +++++++- .../public/vuejs/AccompanyingCourse/store/index.js | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue index bc7aa9ccf..20d21e1c0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/SocialIssue.vue @@ -56,7 +56,13 @@ export default { }, updateSocialIssues(value) { console.log('@@@ CHANGE value', value); - this.$store.dispatch('updateSocialIssues', value); + this.$store.dispatch('updateSocialIssues', this.transformValue(value)); + }, + transformValue(value) { + let payload = value; + let body = {}; //{ type: "social_issue", id: 5 }; + let method = ''; //'POST' : 'DELETE'; + return { payload, body, 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 1ba89a126..3990f8c84 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -178,8 +178,8 @@ let initPromise = getAccompanyingCourse(id) resolve(); })).catch((error) => { commit('catchError', error) }); }, - updateSocialIssues({ commit }, payload) { - console.log('## action: payload', payload); + updateSocialIssues({ commit }, { payload, body, method }) { + console.log('## action: payload', { payload, body, method }); //postSocialIssue(id, body, method) //.then(response => new Promise((resolve, reject) => {