action resolve commit payload, but fetch body+method

This commit is contained in:
Mathieu Jaumotte 2021-05-21 16:44:59 +02:00
parent 68ebd60bc8
commit c1e1f65715
2 changed files with 7 additions and 5 deletions

View File

@ -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,

View File

@ -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);