mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 09:22:26 +00:00
Refactoring
This commit is contained in:
@@ -9,12 +9,8 @@ use actix_web::{
|
||||
HttpRequest,
|
||||
};
|
||||
use rustical_dav::{
|
||||
methods::propfind::{PropElement, PropfindType},
|
||||
resource::{CommonPropertiesProp, EitherProp, Resource},
|
||||
xml::{
|
||||
multistatus::{PropstatWrapper, ResponseElement},
|
||||
MultistatusElement,
|
||||
},
|
||||
xml::{multistatus::ResponseElement, MultistatusElement, PropElement, PropfindType},
|
||||
};
|
||||
use rustical_store::{auth::User, CalendarObject, CalendarStore};
|
||||
use serde::Deserialize;
|
||||
@@ -69,13 +65,8 @@ pub async fn handle_calendar_multiget<C: CalendarStore + ?Sized>(
|
||||
principal: &str,
|
||||
cal_id: &str,
|
||||
cal_store: &C,
|
||||
) -> Result<
|
||||
MultistatusElement<
|
||||
PropstatWrapper<EitherProp<CalendarObjectProp, CommonPropertiesProp>>,
|
||||
String,
|
||||
>,
|
||||
Error,
|
||||
> {
|
||||
) -> Result<MultistatusElement<EitherProp<CalendarObjectProp, CommonPropertiesProp>, String>, Error>
|
||||
{
|
||||
let principal_url = PrincipalResource::get_url(req.resource_map(), vec![principal]).unwrap();
|
||||
let (objects, not_found) =
|
||||
get_objects_calendar_multiget(&cal_multiget, &principal_url, principal, cal_id, cal_store)
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
use actix_web::HttpRequest;
|
||||
use chrono::{DateTime, Utc};
|
||||
use rustical_dav::{
|
||||
methods::propfind::{PropElement, PropfindType},
|
||||
resource::{CommonPropertiesProp, EitherProp, Resource},
|
||||
xml::{multistatus::PropstatWrapper, MultistatusElement},
|
||||
xml::{MultistatusElement, PropElement, PropfindType},
|
||||
};
|
||||
use rustical_store::{auth::User, CalendarObject, CalendarStore};
|
||||
use serde::Deserialize;
|
||||
@@ -210,13 +209,8 @@ pub async fn handle_calendar_query<C: CalendarStore + ?Sized>(
|
||||
principal: &str,
|
||||
cal_id: &str,
|
||||
cal_store: &C,
|
||||
) -> Result<
|
||||
MultistatusElement<
|
||||
PropstatWrapper<EitherProp<CalendarObjectProp, CommonPropertiesProp>>,
|
||||
String,
|
||||
>,
|
||||
Error,
|
||||
> {
|
||||
) -> Result<MultistatusElement<EitherProp<CalendarObjectProp, CommonPropertiesProp>, String>, Error>
|
||||
{
|
||||
let objects = get_objects_calendar_query(&cal_query, principal, cal_id, cal_store).await?;
|
||||
|
||||
let props = match cal_query.prop {
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
use actix_web::{http::StatusCode, HttpRequest};
|
||||
use rustical_dav::{
|
||||
methods::propfind::{PropElement, PropfindType},
|
||||
resource::{CommonPropertiesProp, EitherProp, Resource},
|
||||
xml::{
|
||||
multistatus::{PropstatWrapper, ResponseElement},
|
||||
MultistatusElement,
|
||||
},
|
||||
xml::{multistatus::ResponseElement, MultistatusElement},
|
||||
xml::{PropElement, PropfindType},
|
||||
};
|
||||
use rustical_store::{
|
||||
auth::User,
|
||||
@@ -49,13 +46,8 @@ pub async fn handle_sync_collection<C: CalendarStore + ?Sized>(
|
||||
principal: &str,
|
||||
cal_id: &str,
|
||||
cal_store: &C,
|
||||
) -> Result<
|
||||
MultistatusElement<
|
||||
PropstatWrapper<EitherProp<CalendarObjectProp, CommonPropertiesProp>>,
|
||||
String,
|
||||
>,
|
||||
Error,
|
||||
> {
|
||||
) -> Result<MultistatusElement<EitherProp<CalendarObjectProp, CommonPropertiesProp>, String>, Error>
|
||||
{
|
||||
let props = match sync_collection.prop {
|
||||
PropfindType::Allprop => {
|
||||
vec!["allprop".to_owned()]
|
||||
|
||||
Reference in New Issue
Block a user