update list of referrers when loading and updating some parts of the course

This commit is contained in:
2021-10-20 15:03:42 +02:00
parent c8762d2bc2
commit 0a058bad82
4 changed files with 55 additions and 25 deletions

View File

@@ -15,7 +15,7 @@
v-bind:searchable="true"
v-bind:placeholder="$t('referrer.placeholder')"
v-model="value"
v-bind:options="options"
v-bind:options="referrersAvailable"
@select="updateReferrer">
</VueMultiselect>
</div>
@@ -45,26 +45,13 @@ import { mapState } from 'vuex';
export default {
name: "Referrer",
components: { VueMultiselect },
data() {
return {
options: []
}
},
computed: {
...mapState({
value: state => state.accompanyingCourse.user,
referrersAvailable: state => state.referrersAvailable,
}),
},
mounted() {
this.getOptions();
},
methods: {
getOptions() {
getUsers().then(response => new Promise((resolve, reject) => {
this.options = response.results;
resolve();
}));
},
updateReferrer(value) {
//console.log('value', value);
this.$store.dispatch('updateReferrer', value);