mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 07:02:24 +00:00
event resource: fix path
This commit is contained in:
@@ -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(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user