mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
fetch post resource
This commit is contained in:
@@ -23,9 +23,9 @@ let initPromise = getAccompanyingCourse(id)
|
||||
getters: {
|
||||
},
|
||||
mutations: {
|
||||
removeParticipation(state, item) {
|
||||
//console.log('### mutation: remove item', item.id);
|
||||
state.accompanyingCourse.participations = state.accompanyingCourse.participations.filter(participation => participation !== item);
|
||||
removeParticipation(state, participation) {
|
||||
//console.log('### mutation: remove participation', participation.id);
|
||||
state.accompanyingCourse.participations = state.accompanyingCourse.participations.filter(element => element !== participation);
|
||||
},
|
||||
closeParticipation(state, { participation, payload }) {
|
||||
//console.log('### mutation: close item', { participation, payload });
|
||||
@@ -50,13 +50,13 @@ let initPromise = getAccompanyingCourse(id)
|
||||
//console.log('### mutation: requestorIsAnonymous', value);
|
||||
state.accompanyingCourse.requestorAnonymous = value;
|
||||
},
|
||||
removeInterlocutor(state, interlocutor) {
|
||||
console.log('### mutation: removeInterlocutor', interlocutor);
|
||||
state.accompanyingCourse.resources = state.accompanyingCourse.resources.filter(resource => resource !== interlocutor);
|
||||
removeInterlocutor(state, resource) {
|
||||
console.log('### mutation: removeInterlocutor', resource);
|
||||
state.accompanyingCourse.resources = state.accompanyingCourse.resources.filter(element => element !== resource);
|
||||
},
|
||||
addInterlocutor(state, interlocutor) {
|
||||
console.log('### mutation: addInterlocutor', interlocutor);
|
||||
state.accompanyingCourse.resources.push(interlocutor);
|
||||
addInterlocutor(state, resource) {
|
||||
console.log('### mutation: addInterlocutor', resource);
|
||||
state.accompanyingCourse.resources.push(resource);
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
@@ -122,9 +122,9 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
removeInterlocutor({ commit }, payload) {
|
||||
console.log('## action: fetch postInterlocutor: payload', payload);
|
||||
postResource(id, payload, 'POST')
|
||||
postResource(id, payload, 'DELETE')
|
||||
.then(resource => new Promise((resolve, reject) => {
|
||||
commit('removeInterlocutor', resource)
|
||||
commit('removeInterlocutor', payload) // mieux un retour de l'objet !
|
||||
resolve();
|
||||
}))
|
||||
.catch((error) => {
|
||||
|
Reference in New Issue
Block a user