From c63f859cbcb51e59e4117733d421e7aa0dcb8a8f Mon Sep 17 00:00:00 2001 From: daladim Date: Sat, 17 Apr 2021 19:30:52 +0200 Subject: [PATCH] Implemented delete_item for remote calendars --- src/calendar/remote_calendar.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/calendar/remote_calendar.rs b/src/calendar/remote_calendar.rs index b4dfc10..41f48a7 100644 --- a/src/calendar/remote_calendar.rs +++ b/src/calendar/remote_calendar.rs @@ -145,8 +145,12 @@ impl DavCalendar for RemoteCalendar { Ok(Some(item)) } - async fn delete_item(&mut self, _item_id: &ItemId) -> Result<(), Box> { - log::error!("Not implemented"); + async fn delete_item(&mut self, item_id: &ItemId) -> Result<(), Box> { + reqwest::Client::new() + .delete(item_id.as_url().clone()) + .basic_auth(self.resource.username(), Some(self.resource.password())) + .send() + .await?; Ok(()) } }