event resource: fix path

This commit is contained in:
Lennart
2024-05-29 16:02:54 +02:00
parent 701b5125d6
commit 9568988c17

View File

@@ -37,19 +37,15 @@ pub enum PrincipalPropResponse {
pub struct EventFile { pub struct EventFile {
pub event: Event, pub event: Event,
pub path: String,
} }
impl From<Event> for EventFile {
fn from(event: Event) -> Self {
Self { event }
}
}
impl Resource for EventFile { impl Resource for EventFile {
type PropType = EventProp; type PropType = EventProp;
type PropResponse = PrincipalPropResponse; type PropResponse = PrincipalPropResponse;
fn get_path(&self) -> &str { fn get_path(&self) -> &str {
"asd" &self.path
} }
fn get_prop(&self, _prefix: &str, prop: Self::PropType) -> Result<Self::PropResponse> { fn get_prop(&self, _prefix: &str, prop: Self::PropType) -> Result<Self::PropResponse> {
@@ -90,7 +86,6 @@ impl<C: CalendarStore + ?Sized> ResourceService for EventResource<C> {
.clone() .clone()
.into_inner(); .into_inner();
Ok(Self { Ok(Self {
cal_store, cal_store,
cid, cid,
@@ -106,6 +101,9 @@ impl<C: CalendarStore + ?Sized> ResourceService for EventResource<C> {
.await .await
.get_event(&self.cid, &self.uid) .get_event(&self.cid, &self.uid)
.await?; .await?;
Ok(EventFile { event }) Ok(EventFile {
event,
path: self.path.to_owned(),
})
} }
} }