From d54e7eb9e9d34537025f4091646c042b5a665ac2 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Tue, 20 Aug 2024 17:57:55 +0200 Subject: [PATCH] Added categories back to calendar init --- stores/CalendarStore.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stores/CalendarStore.ts b/stores/CalendarStore.ts index f9f06e8..ac0b964 100644 --- a/stores/CalendarStore.ts +++ b/stores/CalendarStore.ts @@ -49,8 +49,10 @@ export const useCalendar = defineStore('calendar', () => { async function fetchCalendar(id: number) { try { const res = await $fetch('/api/calendars/query', { query: { id, full: true } }) + const categoryRes = await $fetch('/api/calendars/categories/query') const calendarData = res.data as Calendar + const categoryData = categoryRes.data as Category[] if (!calendarData.id) return @@ -63,6 +65,7 @@ export const useCalendar = defineStore('calendar', () => { months.value = calendarData.months baseEvents.value = calendarData.events + categories.value = categoryData } catch (err) { console.log(err) }