mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
adapt payload body to entity convention with type + id
This commit is contained in:
@@ -66,7 +66,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
closeParticipation({ commit }, payload) {
|
||||
console.log('## action: fetch delete participation: payload', payload);
|
||||
postParticipation(id, payload.person.person_id, 'DELETE')
|
||||
postParticipation(id, payload.person, 'DELETE')
|
||||
.then(participation => new Promise((resolve, reject) => {
|
||||
commit('closeParticipation', { participation, payload });
|
||||
resolve();
|
||||
@@ -77,7 +77,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
addParticipation({ commit }, payload) {
|
||||
console.log('## action: fetch post participation (select item): payload', payload);
|
||||
postParticipation(id, payload.result.person_id, 'POST')
|
||||
postParticipation(id, payload.result, 'POST')
|
||||
.then(participation => new Promise((resolve, reject) => {
|
||||
commit('addParticipation', participation);
|
||||
resolve();
|
||||
@@ -86,12 +86,12 @@ let initPromise = getAccompanyingCourse(id)
|
||||
state.errorMsg.push(error.message);
|
||||
});
|
||||
},
|
||||
removeRequestor({ commit }) {
|
||||
removeRequestor({ commit, dispatch }) {
|
||||
console.log('## action: fetch delete requestor');
|
||||
postRequestor(id, null, 'DELETE')
|
||||
.then(requestor => new Promise((resolve, reject) => {
|
||||
commit('removeRequestor');
|
||||
commit('requestorIsAnonymous', false);
|
||||
dispatch('requestorIsAnonymous', false);
|
||||
resolve();
|
||||
}))
|
||||
.catch((error) => {
|
||||
@@ -100,7 +100,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
addRequestor({ commit }, payload) {
|
||||
console.log('## action: fetch post requestor: payload', payload);
|
||||
postRequestor(id, payload, 'POST')
|
||||
postRequestor(id, payload.result, 'POST')
|
||||
.then(requestor => new Promise((resolve, reject) => {
|
||||
commit('addRequestor', requestor);
|
||||
resolve();
|
||||
@@ -111,7 +111,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
requestorIsAnonymous({ commit }, payload) {
|
||||
console.log('## action: fetch patch AccompanyingCourse: payload', payload);
|
||||
patchAccompanyingCourse(id, { requestorAnonymous: payload })
|
||||
patchAccompanyingCourse(id, { type: "accompanying_period", requestorAnonymous: payload })
|
||||
.then(course => new Promise((resolve, reject) => {
|
||||
commit('requestorIsAnonymous', course.requestorAnonymous)
|
||||
resolve();
|
||||
@@ -133,7 +133,7 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
addInterlocutor({ commit }, payload) {
|
||||
console.log('## action: fetch postInterlocutor: payload', payload);
|
||||
postResource(id, payload, 'POST')
|
||||
postResource(id, payload.result, 'POST')
|
||||
.then(resource => new Promise((resolve, reject) => {
|
||||
commit('addInterlocutor', resource)
|
||||
resolve();
|
||||
|
Reference in New Issue
Block a user