mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
action resolve commit payload, but fetch body+method
This commit is contained in:
parent
68ebd60bc8
commit
c1e1f65715
@ -150,7 +150,7 @@ const postResource = (id, payload, method) => {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
const postSocialIssue = (id, body, 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`;
|
const url = `/api/1.0/person/accompanying-course/${id}/socialissue.json`;
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
method: method,
|
method: method,
|
||||||
|
@ -149,7 +149,7 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
})).catch((error) => { commit('catchError', error) });
|
})).catch((error) => { commit('catchError', error) });
|
||||||
},
|
},
|
||||||
toggleIntensity({ commit }, payload) {
|
toggleIntensity({ commit }, payload) {
|
||||||
console.log(payload);
|
//console.log(payload);
|
||||||
patchAccompanyingCourse(id, { type: "accompanying_period", intensity: payload })
|
patchAccompanyingCourse(id, { type: "accompanying_period", intensity: payload })
|
||||||
.then(course => new Promise((resolve, reject) => {
|
.then(course => new Promise((resolve, reject) => {
|
||||||
commit('toggleIntensity', course.intensity);
|
commit('toggleIntensity', course.intensity);
|
||||||
@ -171,7 +171,7 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
})).catch((error) => { commit('catchError', error) });
|
})).catch((error) => { commit('catchError', error) });
|
||||||
},
|
},
|
||||||
postFirstComment({ commit }, payload) {
|
postFirstComment({ commit }, payload) {
|
||||||
console.log('## action: postFirstComment: payload', payload);
|
//console.log('## action: postFirstComment: payload', payload);
|
||||||
patchAccompanyingCourse(id, { type: "accompanying_period", initialComment: payload })
|
patchAccompanyingCourse(id, { type: "accompanying_period", initialComment: payload })
|
||||||
.then(course => new Promise((resolve, reject) => {
|
.then(course => new Promise((resolve, reject) => {
|
||||||
commit('postFirstComment', course.initialComment);
|
commit('postFirstComment', course.initialComment);
|
||||||
@ -179,7 +179,9 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
})).catch((error) => { commit('catchError', error) });
|
})).catch((error) => { commit('catchError', error) });
|
||||||
},
|
},
|
||||||
updateSocialIssues({ commit }, payload) {
|
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) => {
|
//.then(response => new Promise((resolve, reject) => {
|
||||||
// console.log('response', response);
|
// console.log('response', response);
|
||||||
commit('updateSocialIssues', payload);
|
commit('updateSocialIssues', payload);
|
||||||
@ -187,7 +189,7 @@ let initPromise = getAccompanyingCourse(id)
|
|||||||
//})).catch((error) => { commit('catchError', error) });
|
//})).catch((error) => { commit('catchError', error) });
|
||||||
},
|
},
|
||||||
confirmAccompanyingCourse({ commit }) {
|
confirmAccompanyingCourse({ commit }) {
|
||||||
console.log('## action: confirmAccompanyingCourse');
|
//console.log('## action: confirmAccompanyingCourse');
|
||||||
confirmAccompanyingCourse(id)
|
confirmAccompanyingCourse(id)
|
||||||
.then(response => new Promise((resolve, reject) => {
|
.then(response => new Promise((resolve, reject) => {
|
||||||
commit('confirmAccompanyingCourse', response);
|
commit('confirmAccompanyingCourse', response);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user