From 9568988c1762dc2d0e989386c518d4e3d32e3fac Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Wed, 29 May 2024 16:02:54 +0200 Subject: [PATCH] event resource: fix path --- crates/caldav/src/event/resource.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/caldav/src/event/resource.rs b/crates/caldav/src/event/resource.rs index 81e62ca..90f657a 100644 --- a/crates/caldav/src/event/resource.rs +++ b/crates/caldav/src/event/resource.rs @@ -37,19 +37,15 @@ pub enum PrincipalPropResponse { pub struct EventFile { pub event: Event, + pub path: String, } -impl From for EventFile { - fn from(event: Event) -> Self { - Self { event } - } -} impl Resource for EventFile { type PropType = EventProp; type PropResponse = PrincipalPropResponse; fn get_path(&self) -> &str { - "asd" + &self.path } fn get_prop(&self, _prefix: &str, prop: Self::PropType) -> Result { @@ -90,7 +86,6 @@ impl ResourceService for EventResource { .clone() .into_inner(); - Ok(Self { cal_store, cid, @@ -106,6 +101,9 @@ impl ResourceService for EventResource { .await .get_event(&self.cid, &self.uid) .await?; - Ok(EventFile { event }) + Ok(EventFile { + event, + path: self.path.to_owned(), + }) } }