mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
options managed by data, not store
This commit is contained in:
parent
4d12796289
commit
68ebd60bc8
@ -33,11 +33,15 @@ import { mapState, mapActions } from 'vuex';
|
||||
export default {
|
||||
name: "SocialIssue",
|
||||
components: { VueMultiselect },
|
||||
data() {
|
||||
return {
|
||||
options: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
value: state => state.accompanyingCourse.socialIssues,
|
||||
options: state => state.socialIssueOptions,
|
||||
})
|
||||
}),
|
||||
},
|
||||
mounted() {
|
||||
this.getOptions();
|
||||
@ -46,7 +50,7 @@ export default {
|
||||
getOptions() {
|
||||
getSocialIssues().then(elements => new Promise((resolve, reject) => {
|
||||
console.log('get socialIssues', elements.results);
|
||||
this.$store.commit('setSocialIssueOptions', elements.results);
|
||||
this.options = elements.results;
|
||||
resolve();
|
||||
})).catch(error => this.$store.commit('catchError', error));
|
||||
},
|
||||
|
@ -20,7 +20,6 @@ let initPromise = getAccompanyingCourse(id)
|
||||
},
|
||||
state: {
|
||||
accompanyingCourse: accompanying_course,
|
||||
socialIssueOptions: [],
|
||||
errorMsg: []
|
||||
},
|
||||
getters: {
|
||||
@ -82,10 +81,6 @@ let initPromise = getAccompanyingCourse(id)
|
||||
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);
|
||||
state.accompanyingCourse.step = response.step;
|
||||
|
Loading…
x
Reference in New Issue
Block a user