vue accompanyingcourse: ending referrer subcomponent

This commit is contained in:
2021-06-30 11:59:54 +02:00
parent 196f709065
commit d3ac8d8ceb
3 changed files with 66 additions and 43 deletions

View File

@@ -81,6 +81,10 @@ let initPromise = getAccompanyingCourse(id)
updateSocialIssues(state, value) {
state.accompanyingCourse.socialIssues = value;
},
updateReferrer(state, value) {
console.log('value', value);
state.accompanyingCourse.user = value;
},
confirmAccompanyingCourse(state, response) {
//console.log('### mutation: confirmAccompanyingCourse: response', response);
state.accompanyingCourse.step = response.step;
@@ -187,6 +191,13 @@ let initPromise = getAccompanyingCourse(id)
resolve();
})).catch((error) => { commit('catchError', error) });
},
updateReferrer({ commit }, payload) {
patchAccompanyingCourse(id, { type: "accompanying_period", user: { id: payload.id, type: payload.type } })
.then(course => new Promise((resolve, reject) => {
commit('updateReferrer', course.user);
resolve();
})).catch((error) => { commit('catchError', error) });
},
confirmAccompanyingCourse({ commit }) {
//console.log('## action: confirmAccompanyingCourse');
confirmAccompanyingCourse(id)