rdv: fullcalendar: add current user by default

This commit is contained in:
nobohan 2021-08-18 10:48:41 +02:00
parent b40c25595a
commit ca9738b55a

View File

@ -23,6 +23,7 @@
import { fetchCalendarRanges } from './js/api'
import VueMultiselect from 'vue-multiselect';
import { whoami } from 'ChillPersonAssets/vuejs/AccompanyingCourse/api';
const COLORS = ['red', 'green', 'yellow', 'blue', 'orange', 'white', 'grey'];
@ -78,6 +79,13 @@ export default {
console.log(calendarEvents)
this.calendarEvents.loaded = calendarEvents;
whoami().then(me => new Promise((resolve, reject) => {
let currentUser = users.find(u => u.id === me.id);
this.value = currentUser;
this.selectUsers(currentUser);
resolve();
}));
resolve()
}))