Confirm post request, change state step and hide components

This commit is contained in:
2021-05-20 11:45:29 +02:00
parent 050c325195
commit ae1146c79c
5 changed files with 67 additions and 30 deletions

View File

@@ -1,7 +1,8 @@
import 'es6-promise/auto';
import { createStore } from 'vuex';
import { getAccompanyingCourse,
patchAccompanyingCourse,
patchAccompanyingCourse,
confirmAccompanyingCourse,
postParticipation,
postRequestor,
postResource } from '../api';
@@ -75,6 +76,10 @@ let initPromise = getAccompanyingCourse(id)
postFirstComment(state, comment) {
console.log('### mutation: postFirstComment', comment);
state.accompanyingCourse.initialComment = comment;
},
confirmAccompanyingCourse(state, response) {
//console.log('### mutation: confirmAccompanyingCourse: response', response);
state.accompanyingCourse.step = response.step;
}
},
actions: {
@@ -168,6 +173,15 @@ let initPromise = getAccompanyingCourse(id)
commit('postFirstComment', course.initialComment);
resolve();
})).catch((error) => { commit('catchError', error) });
},
confirmAccompanyingCourse({ commit }) {
console.log('## action: confirmAccompanyingCourse');
confirmAccompanyingCourse(id)
.then(response => new Promise((resolve, reject) => {
commit('confirmAccompanyingCourse', response);
resolve();
})).catch((error) => { commit('catchError', error) });
}
}
});