mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
update list of referrers when loading and updating some parts of the course
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user