mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-16 17:48:49 +02:00
Merge branch '46-double-requests-in-room-occupancy' into 'main'
Resolve "double requests in room occupancy" Closes #46 See merge request ekresse/htwkalender!32
This commit is contained in:
@ -28,9 +28,6 @@ type CalenderEvent = {
|
||||
|
||||
const date: Ref<Date> = ref(new Date());
|
||||
|
||||
// Watch for changes in URL parameter
|
||||
router.afterEach(setDateFromQuery);
|
||||
|
||||
// Set the selected date from the URL
|
||||
function setDateFromQuery() {
|
||||
const queryDate = router.currentRoute.value.query.date;
|
||||
@ -81,9 +78,9 @@ async function getOccupation() {
|
||||
showFree: event.free,
|
||||
};
|
||||
});
|
||||
|
||||
const calendar = fullCalendar.value?.getApi();
|
||||
calendar?.refetchEvents();
|
||||
})
|
||||
.finally(() => {
|
||||
fullCalendar.value?.getApi().refetchEvents();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
@ -157,7 +154,7 @@ const calendarOptions: ComputedRef<CalendarOptions> = computed(() => ({
|
||||
router.replace({
|
||||
query: {
|
||||
...router.currentRoute.value.query,
|
||||
date: formatYearMonthDay(startDate),
|
||||
date: formatYearMonthDay(endDate),
|
||||
},
|
||||
});
|
||||
getOccupation();
|
||||
|
Reference in New Issue
Block a user