vue accompanyingCourse, adding an origin sub-component

This commit is contained in:
2021-06-30 17:07:48 +02:00
parent d8256b0ac5
commit 2fe1605385
6 changed files with 109 additions and 6 deletions

View File

@@ -81,6 +81,10 @@ let initPromise = getAccompanyingCourse(id)
updateSocialIssues(state, value) {
state.accompanyingCourse.socialIssues = value;
},
updateOrigin(state, value) {
console.log('value', value);
state.accompanyingCourse.origin = value;
},
updateReferrer(state, value) {
console.log('value', value);
state.accompanyingCourse.user = value;
@@ -191,6 +195,13 @@ let initPromise = getAccompanyingCourse(id)
resolve();
})).catch((error) => { commit('catchError', error) });
},
updateOrigin({ commit }, payload) {
patchAccompanyingCourse(id, { type: "accompanying_period", origin: { id: payload.id, type: payload.type } })
.then(course => new Promise((resolve, reject) => {
commit('updateOrigin', course.origin);
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) => {