mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 07:02:24 +00:00
Error typing for rustical_store as well as some refactoring
This commit is contained in:
@@ -5,7 +5,7 @@ use actix_web::{
|
||||
HttpResponse,
|
||||
};
|
||||
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
|
||||
use rustical_store::store::CalendarStore;
|
||||
use rustical_store::CalendarStore;
|
||||
|
||||
pub async fn route_delete_calendar<A: CheckAuthentication, C: CalendarStore + ?Sized>(
|
||||
context: Data<CalDavContext<C>>,
|
||||
|
||||
@@ -5,7 +5,7 @@ use actix_web::HttpResponse;
|
||||
use anyhow::Result;
|
||||
use rustical_auth::{AuthInfoExtractor, CheckAuthentication};
|
||||
use rustical_store::calendar::Calendar;
|
||||
use rustical_store::store::CalendarStore;
|
||||
use rustical_store::CalendarStore;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
@@ -69,10 +69,7 @@ pub async fn route_mkcol_calendar<A: CheckAuthentication, C: CalendarStore + ?Si
|
||||
return Err(Error::Unauthorized);
|
||||
}
|
||||
|
||||
let request: MkcalendarRequest = quick_xml::de::from_str(&body).map_err(|e| {
|
||||
dbg!(e.to_string());
|
||||
Error::BadRequest
|
||||
})?;
|
||||
let request: MkcalendarRequest = quick_xml::de::from_str(&body)?;
|
||||
let request = request.set.prop;
|
||||
|
||||
let calendar = Calendar {
|
||||
|
||||
@@ -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(),
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@ use rustical_dav::error::Error;
|
||||
use rustical_dav::resource::{Resource, ResourceService};
|
||||
use rustical_dav::xml_snippets::{HrefElement, TextNode};
|
||||
use rustical_store::calendar::Calendar;
|
||||
use rustical_store::store::CalendarStore;
|
||||
use rustical_store::CalendarStore;
|
||||
use serde::Serialize;
|
||||
use std::sync::Arc;
|
||||
use strum::{EnumString, IntoStaticStr, VariantNames};
|
||||
|
||||
Reference in New Issue
Block a user