Error typing for rustical_store as well as some refactoring

This commit is contained in:
Lennart
2024-06-01 13:00:36 +02:00
parent 7fcd9a17f5
commit 1d763b5c8f
20 changed files with 135 additions and 79 deletions

View File

@@ -10,7 +10,7 @@ use rustical_dav::{
resource::HandlePropfind,
};
use rustical_store::event::Event;
use rustical_store::store::CalendarStore;
use rustical_store::CalendarStore;
use serde::{Deserialize, Serialize};
use tokio::sync::RwLock;
@@ -154,10 +154,7 @@ pub async fn route_report_calendar<A: CheckAuthentication, C: CalendarStore + ?S
return Err(Error::Unauthorized);
}
let request: ReportRequest = quick_xml::de::from_str(&body).map_err(|err| {
dbg!(err.to_string());
Error::InternalError
})?;
let request: ReportRequest = quick_xml::de::from_str(&body)?;
let events = match request.clone() {
ReportRequest::CalendarQuery(cal_query) => {
get_events_calendar_query(cal_query, &cid, &cal_store).await?
@@ -178,7 +175,7 @@ pub async fn route_report_calendar<A: CheckAuthentication, C: CalendarStore + ?S
}
PropfindType::Propname => {
// TODO: Implement
return Err(Error::InternalError);
return Err(Error::NotImplemented);
}
PropfindType::Prop(PropElement { prop: prop_tags }) => prop_tags.into(),
};