get options and display selected

This commit is contained in:
2021-05-21 16:04:01 +02:00
parent a88acd34fd
commit 4d12796289
4 changed files with 73 additions and 33 deletions

View File

@@ -5,7 +5,8 @@ import { getAccompanyingCourse,
confirmAccompanyingCourse,
postParticipation,
postRequestor,
postResource } from '../api';
postResource,
postSocialIssue } from '../api';
const debug = process.env.NODE_ENV !== 'production';
const id = window.accompanyingCourseId;
@@ -19,6 +20,7 @@ let initPromise = getAccompanyingCourse(id)
},
state: {
accompanyingCourse: accompanying_course,
socialIssueOptions: [],
errorMsg: []
},
getters: {
@@ -76,6 +78,13 @@ let initPromise = getAccompanyingCourse(id)
postFirstComment(state, comment) {
console.log('### mutation: postFirstComment', comment);
state.accompanyingCourse.initialComment = comment;
},
updateSocialIssues(state, value) {
state.accompanyingCourse.socialIssues = value;
},
setSocialIssueOptions(state, value) {
console.log('## mutation: setSocialIssueOptions', value);
state.socialIssueOptions = value;
},
confirmAccompanyingCourse(state, response) {
//console.log('### mutation: confirmAccompanyingCourse: response', response);
@@ -174,7 +183,14 @@ let initPromise = getAccompanyingCourse(id)
resolve();
})).catch((error) => { commit('catchError', error) });
},
updateSocialIssues({ commit }, payload) {
//postSocialIssue(id, { type: "social_issue", id: payload.id }, payload.method)
//.then(response => new Promise((resolve, reject) => {
// console.log('response', response);
commit('updateSocialIssues', payload);
// resolve();
//})).catch((error) => { commit('catchError', error) });
},
confirmAccompanyingCourse({ commit }) {
console.log('## action: confirmAccompanyingCourse');
confirmAccompanyingCourse(id)