diff --git a/backend/src/handlers/events.rs b/backend/src/handlers/events.rs index 5f3d316..a8f097f 100644 --- a/backend/src/handlers/events.rs +++ b/backend/src/handlers/events.rs @@ -533,8 +533,9 @@ pub async fn update_event( Ok(events) => { for event in events { if event.uid == request.uid { - // Generate event href from UID - let event_href = format!("{}.ics", event.uid); + // Use the actual href from the event, or generate one if missing + let event_href = event.href.clone().unwrap_or_else(|| format!("{}.ics", event.uid)); + println!("🔍 Found event {} with href: {}", event.uid, event_href); found_event = Some((event, calendar_path.clone(), event_href)); break; } @@ -590,9 +591,12 @@ pub async fn update_event( event.priority = request.priority; // Update the event on the CalDAV server + println!("📝 Updating event {} at calendar_path: {}, event_href: {}", event.uid, calendar_path, event_href); client.update_event(&calendar_path, &event, &event_href) .await .map_err(|e| ApiError::Internal(format!("Failed to update event: {}", e)))?; + + println!("✅ Successfully updated event {}", event.uid); Ok(Json(UpdateEventResponse { success: true,