fix(calendar): use r.Route subrouter to avoid chi path ambiguity with /channels/events/{eventID}

This commit is contained in:
2026-07-09 14:43:34 -04:00
parent 9a6f15662b
commit af913b9923
4 changed files with 14 additions and 3 deletions
+5 -1
View File
@@ -49,7 +49,11 @@ export function CalendarView({ channelId, channelName }: CalendarViewProps) {
const to = `${date.getFullYear()}-${String(date.getMonth() + 2).padStart(2, '0')}-01T00:00:00Z`;
setLoading(true);
api.get<CalendarEvent[]>(`/channels/${channelId}/events?from=${encodeURIComponent(from)}&to=${encodeURIComponent(to)}`)
.then((data) => setEvents(Array.isArray(data) ? data : []))
.then((data) => {
console.log('[calendar] loaded', data?.length, 'events for channel', channelId);
setEvents(Array.isArray(data) ? data : []);
})
.catch((err) => console.error('[calendar] fetch error:', err))
.finally(() => setLoading(false));
}, [channelId, date]);