Add calendar selection dropdown and fix multi-calendar event display

- Add calendar selection dropdown to event creation modal
- Update EventCreationData to include selected_calendar field
- Pass available calendars from user info to modal component
- Initialize dropdown with first available calendar as default
- Fix backend to fetch events from ALL calendars, not just the first
- Update refresh_event to search across all calendars
- Events created in any calendar now properly display in UI

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-08-29 08:45:40 -04:00
parent 7a53228ec8
commit e1578ed11c
3 changed files with 92 additions and 17 deletions

View File

@@ -273,11 +273,12 @@ pub fn App() -> Html {
reminder_str,
recurrence_str,
event_data.recurrence_days,
None // Let backend use first available calendar
event_data.selected_calendar
).await {
Ok(_) => {
web_sys::console::log_1(&"Event created successfully".into());
// Refresh the page to show the new event
// Trigger a page reload to refresh events from all calendars
// TODO: This could be improved to do a more targeted refresh
web_sys::window().unwrap().location().reload().unwrap();
}
Err(err) => {
@@ -542,6 +543,7 @@ pub fn App() -> Html {
move |_| create_event_modal_open.set(false)
})}
on_create={on_event_create}
available_calendars={user_info.as_ref().map(|ui| ui.calendars.clone()).unwrap_or_default()}
/>
</div>
</BrowserRouter>