options managed by data, not store

This commit is contained in:
2021-05-21 16:22:33 +02:00
parent 4d12796289
commit 68ebd60bc8
2 changed files with 7 additions and 8 deletions

View File

@@ -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));
},