Migrate from Event type to CalendarObject

This is preparation to support other calendar components like VTODO and
VJOURNAL
This commit is contained in:
Lennart
2024-09-30 19:35:54 +02:00
parent 41d68f9ae0
commit b3a7806139
14 changed files with 229 additions and 161 deletions

View File

@@ -15,7 +15,7 @@ use serde::Deserialize;
use tokio::sync::RwLock;
use crate::{
event::resource::{EventProp, EventResource},
calendar_object::resource::{CalendarObjectProp, CalendarObjectResource},
Error,
};
@@ -49,7 +49,7 @@ pub async fn handle_sync_collection<C: CalendarStore + ?Sized>(
principal: &str,
cid: &str,
cal_store: &RwLock<C>,
) -> Result<MultistatusElement<PropstatWrapper<EventProp>, String>, Error> {
) -> Result<MultistatusElement<PropstatWrapper<CalendarObjectProp>, String>, Error> {
let props = match sync_collection.prop {
PropfindType::Allprop => {
vec!["allprop".to_owned()]
@@ -73,7 +73,7 @@ pub async fn handle_sync_collection<C: CalendarStore + ?Sized>(
for event in new_events {
let path = format!("{}/{}", req.path(), event.get_uid());
responses.push(
EventResource::from(event)
CalendarObjectResource::from(event)
.propfind(prefix, &path, props.clone())
.await?,
);